php-http/client-integration-tests
Integration test suite for PHP-HTTP clients. Helps verify that any HTTPlug/PSR-18 compatible client behaves correctly and consistently across common scenarios, making it easier to validate implementations and avoid regressions.
This package provides a shared suite of integration tests for PHP HTTP clients, ensuring compliance with the PSR-18 HTTP client interface and_HTTP Message interfaces. To get started:
require-dev: composer require --dev php-http/client-integration-testsHttp\Client\Tests\IntegrationTestCasecreateClient() method to return an instance of your HTTP client (e.g., Guzzle, CurlHttpClient)phpunit — it will automatically execute ~100+ tests validating standard client behavior, async support, streaming, and edge casesFirst use case: verifying your custom or third-party PSR-18 client implementation behaves correctly across realistic HTTP scenarios (redirects, authentication, timeouts, etc.)
getOptions() method to inject custom handler stacks or middleware (e.g., retry middleware, logging) to test integration with middleware enabledIntegrationTestCase to add domain-specific assertions (e.g., assert caching behavior, header transformations) without losing the core compliance suitecreateClient() to instantiate different client implementations (e.g., one for Guzzle 7, one for Symfony HttpClient), ensuring parity across adapterslocalhost:8080 by default); ensure no firewall blocks port 8080 or consider customizing getServerUrl() or using setServerUrl() in your test bootstrapext-uv or ext-reactphp; run tests with --exclude-group async if dependencies are unavailableclientOptions in setUp() or adjust via environment variables (HTTP_CLIENT_TEST_TIMEOUT)-vvv; most failures include the exact request/response trace (URI, headers, body) — inspect logs for mismatches in PSR-7 message semantics (e.g., headers-as-array vs string)php-http/mock-client or symfony/http-client-contracts test helpers for unit-level mocksHow can I help you explore Laravel packages today?