mcustiel/phiremock-client
PHP client for Phiremock Server with a fluent API to define HTTP expectations, manage scenarios, and reset server state. Works with Guzzle 6 by default, or any PSR-18 HTTP client by overriding the factory for custom connections.
Adopt if:
Look elsewhere if:
Http::fake() or Mockery may suffice.For Executives: "This package lets our Laravel team programmatically control HTTP mocks—critical for fast, reliable API testing and local development. By integrating with Phiremock Server, we avoid vendor lock-in while gaining scenario-driven testing (e.g., simulating payment failures, multi-step workflows). The JSON Path support (v2.0+) unlocks advanced data validation, reducing bugs in integrations. Low risk: Open-source, PHP 8.2+ aligned with Laravel 10+, and future-proofs our test infrastructure."
For Engineering: *"Phiremock Client gives us a Laravel-native way to manage mocks in tests/CI. Key wins:
respond(418)->andBody('Teapot')) instead of JSON/YAML.setScenarioState('checkout', 'payment_failed')).$response->jsonPath('$.data.user.id')) for dynamic assertions.listExecutions() to debug mock traffic. Blockers: PHP 8.2+ required; pair with Phiremock Server."*For QA/Test Teams: *"This replaces manual mock setups (e.g., Postman) with code-driven mocks that:
$client->reset()).
Example: Test a payment API’s retry logic by defining a scenario with priority(5) and respond(429).
Try it: Use the helper functions (e.g., on(getRequest('/api/pay'))->then(respond(200))) to mock a single endpoint."*How can I help you explore Laravel packages today?