Stubs network requests by describing them and the expected responses (data, status, delay...). It can be useful for testing code behaviors in different real network situations and it make it simple.
Write a requests-stubs.yaml file configuring requests you want the server respond to and associated responses. Then you can tests your requests on the specified port (localhost:9000 in the example) by running php public/index.php. .
Tests are written with Behat, we run an instance of the server and then run expected behavior with the requests-stubs .yml file. To run test you have two methods:
- Run the server php public/index.php and then exec vendor/bin/behat
- Use composer test to run via docker (used for CI). If you change port in requests-stubs.yml, don't forget to change it in test.sh
vendor/bin/behat
- AMPHP Http server - An async http server in PHP
- Symfony Config - A powerfull configuration component
- Behat - A behavior driven development framework
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Rémy Théroux - Initial work - remy-theroux
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details