php-http / mock-client
Mock HTTP client
Installs: 6 770 779
Dependents: 685
Suggesters: 6
Security: 0
Stars: 69
Watchers: 8
Forks: 18
Open Issues: 1
Requires
- php: ^7.1 || ^8.0
- php-http/client-common: ^2.0
- php-http/discovery: ^1.16
- php-http/httplug: ^2.0
- psr/http-client: ^1.0
- psr/http-factory-implementation: ^1.0
- psr/http-message: ^1.0 || ^2.0
- symfony/polyfill-php80: ^1.17
Requires (Dev)
- phpspec/phpspec: ^5.1 || ^6.1 || ^7.3
Provides
README
Mock HTTP client
Install
Via Composer
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 section in the official documentation.
Testing
composer test
Contributing
Please see our contributing guide.
Security
If you discover any security related issues, please contact us at security@php-http.org.
Credits
Thanks to David de Boer for implementing the mock client.
License
The MIT License (MIT). Please see License File for more information.