- What is http-interop/http-factory-tests used for?
- It is a conformance test suite for PSR-17 HTTP factory implementations. You add its vendor test directory to phpunit.xml and point constants at your request, response, server request, stream, uploaded file, and URI factories. It validates factory behavior rather than Laravel's HTTP kernel.
- Does http-interop/http-factory-tests work with Laravel?
- Only if your Laravel application explicitly uses PSR-17 factories, such as through nyholm/psr7 or Guzzle's PSR-17 implementation. The standard Laravel HTTP layer uses Symfony HTTP Foundation and does not need this package. Do not adopt it as a replacement for Laravel's own HTTP test helpers.
- How do I install http-interop/http-factory-tests?
- Install it as a dev dependency with composer require --dev http-interop/http-factory-tests:^2.4. Pin your PHPUnit version in the same step and confirm the resolved Composer combination. Use composer why-not phpunit/phpunit 13.x to surface conflicts.
- How do I configure phpunit.xml for http-interop/http-factory-tests?
- Add the vendor/http-interop/http-factory-tests/test directory to a testsuite and define the REQUEST_FACTORY, RESPONSE_FACTORY, SERVER_REQUEST_FACTORY, STREAM_FACTORY, UPLOADED_FILE_FACTORY, and URI_FACTORY constants. The values must be fully qualified class names for your implementations. Enable backupGlobals as shown in the README.
- Which PHPUnit versions does http-interop/http-factory-tests support?
- Release 2.4.0 widens the Composer constraint to allow PHPUnit 13.x, and earlier lines such as 9, 10, 11, and 12 are presumed supported through the range. The maintainers have not documented a formal support window. Verify the exact resolved version in your project before relying on it.
- Does http-interop/http-factory-tests require PHP 8.4?
- PHPUnit 13 requires PHP 8.4 or newer, but the package itself does not force that runtime. Projects on PHP 8.1 through 8.3 will resolve an older PHPUnit line. Confirm your PHP and PHPUnit combination before assuming the newest support applies.
- Is http-interop/http-factory-tests safe to use in production?
- It is a dev-only test dependency and should not be installed or deployed to production. Its assertions validate PSR-17 factory conformance, not application security or runtime behavior. Keep it out of production autoloading and deploy steps.
- What alternatives exist for PSR-17 factory testing in Laravel?
- You can write your own PHPUnit tests against the PSR-17 interfaces or use framework-specific assertions for your factory implementations. For Laravel HTTP behavior, use Laravel's HTTP test helpers instead. This package remains useful when you need isolated, framework-agnostic PSR-17 conformance checks.
- Is http-interop/http-factory-tests actively maintained?
- Maintenance is low-activity but the project is not abandoned; release 2.4.0 adds PHPUnit 13.x support. A single dependency bump does not prove the suite passes on PHPUnit 13.x or establish a release cadence. Ask for CI build matrix evidence before relying on it.
- Will http-interop/http-factory-tests conflict with Laravel testing helpers?
- It can conflict if you run the conformance suite alongside Laravel's container-bound factories and Http::fake() fixtures. Run it as a dedicated CI job in isolation to avoid fixture and container coupling. The suite is framework-agnostic and does not require Laravel's HTTP kernel.