php-http/mock-client
Mock HTTP client for HTTPlug/PHP-HTTP. Stores outgoing requests and returns queued responses or throws exceptions instead of making real network calls—ideal for unit tests of HTTP-dependent code. Install via Composer as a dev dependency.
Adopt this package when your project uses HTTPlug or PSR-18-compliant HTTP clients and requires deterministic, isolated testing of HTTP interactions. Ideal for teams needing to simulate predefined responses/errors in unit tests while maintaining speed and reliability. Avoid if your stack uses non-PSR-18 clients (e.g., direct Guzzle usage without abstraction), requires dynamic response generation based on request content, or needs complex integration testing (e.g., stateful multi-service workflows—opt for Wire
How can I help you explore Laravel packages today?