- 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.