First try of using pact (setup from: https://github.com/andykelk/pact-php)
- Clone the repo
- Install pact mock service:
- Install Ruby and Ruby Gems
- Run bundler to get the gems:
gem install bundler && bundle install
-
Install composer: curl -sS https://getcomposer.org/installer | php
-
Install dependencies: php composer.phar install
-
Start the mock server:
bundle exec pact-mock-service -p 1234 --pact-specification-version 2.0.0 -l log/pact.logs --pact-dir tmp/pacts
-
Setup Pact Broker instance with docker-compose (see).
run
docker-compose pull docker-compose up -d db docker-compose up
-
Run phpunit:
./vendor/bin/phpunit --bootstrap=vendor/autoload.php tests/
-
Inspect the pact file in
tmp/pacts
-
Open 'http://127.0.0.1:5000' in your browser and you will be in awe!