Practical Contract Testing with Pact in PHP
summary
Consumer-side PHPUnit tests using Pact and Guzzle generate a JSON pact file; the mock server simulates the provider and the pact provider verifier downloads that pact and runs it against a Laravel provider instance — initial verification fails until a hard‑coded /products endpoint is added, then verification passes. Matcher-based matching rules replace strict arrays to allow multiple products. Flow can publish versioned pacts to a Pact broker for CI and documentation.
AI-written summary · about
chapters (7)
- 0:00Introduction to pact
- 1:40Contract testing concepts
- 4:36Tooling and workflow
- 10:01Understanding pact components
- 15:09How pact works
- 20:16Live coding session
- 40:29Benefits and conclusion
related talks
35mContract Testing and Laravel: Reliability in APIs Between Microservices
01h 13mContract Testing Made Easy: Master Pact for Microservices in C#
59mUsing Pact to Deploy Microservice with Confidence
09m"Contract Testing 101"
39mPacts to the Rescue! Making your microservices play nicely together
32mConsumer-Driven Contract: A better approach for API Testing
24mHow to test microservices and stay sane
22mCollaborating with Contracts
