Skip to content

Commit ed17728

Browse files
minor #57689 [Contracts][HttpClient] Skip tests when zlib's ob_gzhandler() doesn't exist (alexandre-daubois)
This PR was merged into the 5.4 branch. Discussion ---------- [Contracts][HttpClient] Skip tests when zlib's `ob_gzhandler()` doesn't exist | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT When using a minimal PHP binary without enabling special ext, `ob_gzhandler` may not be available making a lot of HttpClient's tests fail. The function is used here: https://github.com/symfony/symfony/blob/7.2/src/Symfony/Contracts/HttpClient/Test/Fixtures/web/index.php#L46 Commits ------- 97e713b7f9 [Contracts][HttpClient] Skip tests when zlib's `ob_gzhandler()` doesn't exist
2 parents 88cdf42 + 1663725 commit ed17728

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

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());

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();

0 commit comments

Comments
 (0)