diff --git a/CurlHttpClient.php b/CurlHttpClient.php index 3a2fba0..19bd456 100644 --- a/CurlHttpClient.php +++ b/CurlHttpClient.php @@ -67,7 +67,7 @@ final class CurlHttpClient implements HttpClientInterface, LoggerAwareInterface, * * @see HttpClientInterface::OPTIONS_DEFAULTS for available options */ - public function __construct(array $defaultOptions = [], int $maxHostConnections = 6, int $maxPendingPushes = 50) + public function __construct(array $defaultOptions = [], int $maxHostConnections = 6, int $maxPendingPushes = 0) { if (!\extension_loaded('curl')) { throw new \LogicException('You cannot use the "Symfony\Component\HttpClient\CurlHttpClient" as the "curl" extension is not installed.'); diff --git a/Tests/CurlHttpClientTest.php b/Tests/CurlHttpClientTest.php index 3ff0c9a..8e50d13 100644 --- a/Tests/CurlHttpClientTest.php +++ b/Tests/CurlHttpClientTest.php @@ -22,17 +22,19 @@ class CurlHttpClientTest extends HttpClientTestCase { protected function getHttpClient(string $testCase): HttpClientInterface { - if (false !== strpos($testCase, 'Push')) { - if (\PHP_VERSION_ID >= 70300 && \PHP_VERSION_ID < 70304) { - $this->markTestSkipped('PHP 7.3.0 to 7.3.3 don\'t support HTTP/2 PUSH'); - } - - if (!\defined('CURLMOPT_PUSHFUNCTION') || 0x073D00 > ($v = curl_version())['version_number'] || !(\CURL_VERSION_HTTP2 & $v['features'])) { - $this->markTestSkipped('curl <7.61 is used or it is not compiled with support for HTTP/2 PUSH'); - } + if (!str_contains($testCase, 'Push')) { + return new CurlHttpClient(['verify_peer' => false, 'verify_host' => false]); } - return new CurlHttpClient(['verify_peer' => false, 'verify_host' => false]); + if (\PHP_VERSION_ID >= 70300 && \PHP_VERSION_ID < 70304) { + $this->markTestSkipped('PHP 7.3.0 to 7.3.3 don\'t support HTTP/2 PUSH'); + } + + if (!\defined('CURLMOPT_PUSHFUNCTION') || 0x073D00 > ($v = curl_version())['version_number'] || !(\CURL_VERSION_HTTP2 & $v['features'])) { + $this->markTestSkipped('curl <7.61 is used or it is not compiled with support for HTTP/2 PUSH'); + } + + return new CurlHttpClient(['verify_peer' => false, 'verify_host' => false], 6, 50); } public function testBindToPort()