https://github.com/php-http/mock-client
Mock HTTP client
https://github.com/php-http/mock-client
Last synced: 10 months ago
JSON representation
Mock HTTP client
- Host: GitHub
- URL: https://github.com/php-http/mock-client
- Owner: php-http
- License: mit
- Created: 2015-06-15T12:39:45.000Z (over 10 years ago)
- Default Branch: 1.x
- Last Pushed: 2024-10-31T10:30:45.000Z (about 1 year ago)
- Last Synced: 2025-04-01T09:21:17.783Z (10 months ago)
- Language: PHP
- Homepage: http://httplug.io
- Size: 88.9 KB
- Stars: 69
- Watchers: 7
- Forks: 17
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Mock Client
[](https://github.com/php-http/mock-client/releases)
[](LICENSE)
[](https://github.com/php-http/mock-client/actions/workflows/tests.yml)
[](https://packagist.org/packages/php-http/mock-client)
**Mock HTTP client**
## Install
Via Composer
```bash
composer require --dev php-http/mock-client
```
## Usage
This client does not actually send requests to any server.
Instead it stores the request and returns a pre-set response or throws an exception. This client is useful for unit
testing code that depends on a HTTPlug client to send requests and receive responses.
## Documentation
Please see the [mock client](http://docs.php-http.org/en/latest/clients/mock-client.html) section in the [official documentation](http://docs.php-http.org).
## Testing
```bash
composer test
```
## Contributing
Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html).
## Security
If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org).
## Credits
Thanks to [David de Boer](https://github.com/ddeboer) for implementing the mock client.
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.