Here is a basic end-to-end example sans Broker and CI integration for Pact-PHP. This example is based on the Meetup.com API written for the Austin PHP Meetup. Here we setup a scenario with two consumers/clients and one provider/api.
This example is targeting the Pact-PHP 3.X and above. If you want to look at the 2.2.1 tag to see the Pact-PHP 2.X implementation.
- Use the Meetup.com API to pull
categories
version 2 - Build a mock and publish a PACT using Pact PHP 3.0 matchers to a local folder
- Run using test/run_test.bat
- Use the Meetup.com API to pull
cities
on version 2 - Use the Meetup.com API to pull
dashboards
- Build a mock and publish a PACT with both interactions to a local folder
- Run using test/run_test.bat
- Under the src folder, pretend we are Meetup.com and we want to test against our clients.
- Pull the Pacts
- Configure an API end point to setup state for the Example Two Client dashboards end point. This is under the src/state section.
- Run using test/run_test.bat
- The unit tests kill the server after three minutes