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.
symfony/http-foundation or nyholm/psr7), though PHP 8.1+ is now required.createRequest(), createResponse()) without side effects in PHP 8.1+?HttpTestCase or Mockery for PHP 8.1+ projects?composer require --dev psr-mock/http-factory-implementation:^1.0
use PsrMock\HttpFactory\MockHttpFactory;
$factory = new MockHttpFactory(); // Requires PHP 8.1+
$request = $factory->createRequest('GET', '/test');
$this->app->instance(\Psr\Http\Message\RequestFactoryInterface::class, $factory);
Http facade or custom clients (e.g., Guzzle) only if PHP 8.1+ is supported.Mockery or hardcoded responses).Mockery or Laravel’s HttpTestCase if PHP upgrades are blocked or issues arise.pest or phpunit parallelization if PHP 8.1+ is used.GET /api request) after PHP upgrade.How can I help you explore Laravel packages today?