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
Client Integration Tests

Client Integration Tests Laravel Package

php-http/client-integration-tests

Integration test suite for PHP HTTP clients and adapters. Provides a shared test server and PHPUnit testsuite so you can verify that your client correctly implements the PSR-18 and HTTPlug contracts against real HTTP requests.

View on GitHub
Deep Wiki
Context7

HTTP Client integration tests is a shared test suite for HTTPlug-compatible HTTP clients and adapters. It ships a local HTTP test server and ready-made PHPUnit test suites, so adapter authors can verify real-world request/response behavior—headers, redirects, streaming, and error handling—without writing their own fixtures.

Install it with Composer, start vendor/bin/http_test_server, then run a suite such as phpunit --testsuite curl --printer "Http\Client\Tests\ResultPrinter".

  • Bundled HTTP test server for deterministic integration testing
  • Per-adapter PHPUnit test suites with a custom result printer
  • Validates PSR-7/PSR-18 client behavior end to end
  • Drop-in setup for any HTTPlug client or adapter
  • MIT licensed and maintained by the php-http organization
Frequently asked questions about Client Integration Tests
Can I use php-http/client-integration-tests to test Laravel HTTP client calls?
No, not for typical application-level HTTP testing in Laravel. This package is a black-box conformance suite for people who implement or maintain PSR-18 clients and adapters. For Laravel HTTP client tests, use Http::fake and Http::preventStrayRequests instead. The package is require-dev only and has no runtime role in a Laravel app.
What is php-http/client-integration-tests used for?
It provides a reusable IntegrationTestCase, a bundled local HTTP test server, and PHPUnit suites that check redirects, authentication, timeouts, streaming, header semantics, and optional async behavior. Client and adapter maintainers subclass the test case and run it against their implementation. The README explicitly says it should not be used on its own.
How do I install php-http/client-integration-tests?
Install it as a dev dependency with composer require --dev php-http/client-integration-tests. Start the bundled server with vendor/bin/http_test_server, install the adapter and PSR-7 implementation you want to test, then run PHPUnit with the package testsuite and custom result printer. This is maintainer-oriented setup, not a normal Laravel application test install.
Does php-http/client-integration-tests support Laravel 10 and Laravel 11?
The package is not coupled to Laravel versions; the real constraints are PHP and PHPUnit. Version 4.0.0 targets PHPUnit greater than 9, while modern Laravel projects often use PHPUnit 10 or 11 and Pest. Whether the test classes run cleanly there needs a small spike rather than a docs read, and there is no Laravel-specific integration to rely on.
Why does the README say this package should not be used on its own?
Because it is a reusable test kit, not an application library. It ships an IntegrationTestCase and a local test server that expect an adapter or PSR-18 client under test plus a PHPUnit configuration. Running it by itself does not validate a real client implementation.
Does php-http/client-integration-tests require network access or httpbin.org?
The suite includes a local HTTP test server, usually on port 8080, so many checks can run locally. However, the history noted a 3.1.1 revert to httpbin.org after a migration, so verify which tests require public egress in your pinned version. External endpoints add rate-limit, availability, and CI firewall failure modes you do not control.
How do I run php-http/client-integration-tests in CI?
Run the local server as a background process, wait until its port is ready, install the adapter under test, then invoke PHPUnit with the package testsuite and custom printer. In containers you must account for port binding and process cleanup. Unless you have ext-uv or ReactPHP coverage, exclude the async group. Assign an owner and pin the version so the job does not become orphaned and flaky.
Does php-http/client-integration-tests support async HTTP clients?
Async coverage is optional and depends on transports such as ext-uv or ReactPHP. In many CI setups the practical choice is to run with --exclude-group async, which means you get less than the headline roughly 100 tests. Only add async coverage if your client actually supports those transports and you can maintain the extra CI complexity.
What are alternatives to php-http/client-integration-tests for Laravel HTTP testing?
For Laravel application tests, use Http::fake, Http::preventStrayRequests, and targeted assertions around your own code. For unit-level HTTP mocking, php-http/mock-client is the closer fit, and Guzzle is already validated upstream by the ecosystem. This package is only for proving PSR-18 and PSR-7 client conformance.
Is php-http/client-integration-tests maintained and safe for production?
It is require-dev only, so it cannot ship in production runtime, and it has MIT licensing plus the php-http organization and a long changelog behind it. The risk is supply-chain verification and maintenance: adoption signals are weak at 16 stars and zero listed dependents, and the recorded 2026-07-05 release date is a data-quality red flag. Confirm the actual latest tag and commit history on Packagist and GitHub before approval, and assume volunteer-driven bus factor risk.
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.
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support