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.
require-dev line and a CI job.php-http/curl-client, or a newer PSR-18 implementation, this package provides an objective, standards-anchored scorecard instead of opinion-driven review. The output is a pass/fail matrix a PM can put in a decision memo.Http::fake(), Http::preventStrayRequests(), or contract tests against our own APIs. Making that boundary explicit in an RFC is itself a decision — it prevents scope creep into application test suites and keeps the app teams' test layers clean.Adopt only when all of the following hold:
vendor/bin/http_test_server, default port 8080) and have an owner for that job. An unowned CI job becomes a flaky orphan within two quarters.httpbin.org; anywhere public-network egress appears in CI introduces availability and rate-limit failure modes outside our control.--exclude-group async unless you genuinely ship an async transport — async coverage depends on ext-uv/ReactPHP, so the "~100 tests" headline is an upper bound.Look elsewhere when:
Illuminate\Support\Facades\Http. Guzzle is already validated upstream; the marginal value here is near zero.Http::fake(), Http::preventStrayRequests(), or php-http/mock-client.To executives (one paragraph). This is a small, MIT-licensed, dev-only test suite that proves an HTTP client implementation actually behaves correctly against the PSR-18 standard. It ships a local test server and roughly a hundred scenario checks, and never touches production — it is a require-dev dependency with zero runtime footprint. Its value is narrow but real: it turns "which HTTP client should we use, and is upgrading safe?" from a judgment call into a scored, repeatable test. It is not a feature, not a customer-facing change, and not a replacement for our existing application tests. Recommend a timeboxed one-to-two-day evaluation spike, owned by platform engineering, with a clear go/no-go: does our target PHPUnit version actually run these tests cleanly, and can we run them fully offline in CI? If either answer is no, we decline and lose nothing. Risks to note: single-organization, volunteer-driven maintenance (bus factor is the real risk, not code quality), weak adoption signals, and one repository metric that appears unreliable. All are manageable for a dev-only tool, none are acceptable for a production dependency — which is why the dev-only scoping is the whole point.
To engineering leads. The pitch is standardization and regression gating, not coverage. One subclass, one PHPUnit testsuite, one CI job, one pinned version — and you get an objective conformance result for your configured client stack (inject your retries/logging/auth middleware via getOptions() so you test what you actually ship, not a bare client). The honest costs: a local server process on port 8080 in containers, PHPUnit major-version coupling that surfaces as runtime breakage rather than a Composer conflict, a hard break at 4.0.0 for anyone sub-classing against 3.x ($messageFactory replaced by $requestFactory/$streamFactory), and an async story that in practice means --exclude-group async. Ask two questions before writing code: do we actually own a PSR-18 client, and is the target PHPUnit major supported in fact rather than by constraint? Answer those in a spike, not a design doc, then either adopt with a named owner and an upgrade task attached to every future PHPUnit bump — or walk away with a one-paragraph rationale on file.
How can I help you explore Laravel packages today?