Skip to content

Commit 97e713b

Browse files
[Contracts][HttpClient] Skip tests when zlib's ob_gzhandler() doesn't exist
1 parent b437362 commit 97e713b

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/Symfony/Component/HttpClient/Tests/HttplugClientTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public static function tearDownAfterClass(): void
3737
TestHttpServer::stop();
3838
}
3939

40+
/**
41+
* @requires function ob_gzhandler
42+
*/
4043
public function testSendRequest()
4144
{
4245
$client = new HttplugClient(new NativeHttpClient());
@@ -51,6 +54,9 @@ public function testSendRequest()
5154
$this->assertSame('HTTP/1.1', $body['SERVER_PROTOCOL']);
5255
}
5356

57+
/**
58+
* @requires function ob_gzhandler
59+
*/
5460
public function testSendAsyncRequest()
5561
{
5662
$client = new HttplugClient(new NativeHttpClient());

src/Symfony/Component/HttpClient/Tests/Psr18ClientTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ public static function tearDownAfterClass(): void
3333
TestHttpServer::stop();
3434
}
3535

36+
/**
37+
* @requires function ob_gzhandler
38+
*/
3639
public function testSendRequest()
3740
{
3841
$factory = new Psr17Factory();

src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ abstract class HttpClientTestCase extends TestCase
2525
{
2626
public static function setUpBeforeClass(): void
2727
{
28+
if (!function_exists('ob_gzhandler')) {
29+
static::markTestSkipped('The "ob_gzhandler" function is not available.');
30+
}
31+
2832
TestHttpServer::start();
2933
}
3034

0 commit comments

Comments
 (0)