Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Http Factory Tests

Http Factory Tests Laravel Package

http-interop/http-factory-tests

Unit tests for HTTP Factory implementations. Add test suite config to phpunit.xml and define factory class constants, then validate your PSR-17 request, response, server request, stream, uploaded file, and URI factories.

View on GitHub
Deep Wiki
Context7

http-interop/http-factory-tests provides a ready-made PHPUnit test suite for validating implementations of the PSR-17 HTTP Factory interfaces. Instead of writing repetitive compliance tests yourself, you wire in your own factory classes via phpunit.xml constants and run the suite to confirm each factory behaves correctly.

  • Covers Request, Response, ServerRequest, Stream, UploadedFile, and Uri factories
  • Integrates through simple phpunit.xml constants
  • Promotes PSR-17 interoperability and spec compliance
  • Requires minimal setup in existing test suites
Frequently asked questions about Http Factory Tests
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.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections