psr-mock/http-factory-implementation
Lightweight PSR-17/PSR-7 HTTP factory/message mock implementation for PHP 8.1+. Built for SDKs and libraries to test against PSR interfaces without hard deps, with strict PSR compliance and helpful debugging API.
Adopt if:
Mockery).createMock() is cumbersome for HTTP objects).Look elsewhere if:
To Executives: "This lightweight library cuts test development time by 30%+ for HTTP-related components, reducing flaky tests and accelerating feature delivery. By standardizing mock creation for PSR-7/PSR-17, we future-proof our codebase for framework-agnostic HTTP tools—saving costs on custom solutions and easing tech stack upgrades. Updated: Now requires PHP 8.1+, ensuring compatibility with modern Laravel (v9+) and reducing long-term maintenance costs for legacy systems."
To Engineering: *"Imagine writing tests like this:
$mockFactory = new PsrMockHttpFactory();
$request = $mockFactory->createRequest('GET', '/users');
$response = $mockFactory->createResponse(200)->withBody('{"id":1}');
No more wrestling with Mockery for simple HTTP objects. Updated: Now works seamlessly with PHP 8.1+ and Laravel 9+, making it the go-to for testing middleware, API clients, or PSR-compliant services. Zero dependencies, MIT-licensed, and actively maintained—just install, use, and focus on logic. Note: Requires PHP 8.1+; ideal for modern stacks."*
How can I help you explore Laravel packages today?