pock

pock documentation

pock is an HTTP mocking library for tests that works with PSR-18, HTTPlug, and Symfony HTTP Client. Define the requests your code is expected to send, attach responses or failures, and inject the resulting client into the code under test.

Start here

A mock is consumed once by default. Define several mocks on one builder when a test makes several requests, or use repeat() and always() when a mock must remain available.

The API reference contains the complete method-level documentation.

Search results