From c5caa0d7e233a6e1beb62c2f3c798c04cfcf21ce Mon Sep 17 00:00:00 2001 From: lubiana Date: Tue, 27 Aug 2024 18:41:41 +0200 Subject: [PATCH] add case for Macos in ResponseTest::testResponseBodyCallbackGzip --- tests/ResponseTest.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/ResponseTest.php b/tests/ResponseTest.php index b646294..fade322 100644 --- a/tests/ResponseTest.php +++ b/tests/ResponseTest.php @@ -318,7 +318,16 @@ class ResponseTest extends TestCase ob_start(); $response->send(); $gzip_body = ob_get_clean(); - $expected = PHP_OS === 'WINNT' ? 'H4sIAAAAAAAACitJLS4BAAx+f9gEAAAA' : 'H4sIAAAAAAAAAytJLS4BAAx+f9gEAAAA'; + switch (PHP_OS) { + case 'WINNT': + $expected = 'H4sIAAAAAAAACitJLS4BAAx+f9gEAAAA'; + break; + case 'Darwin': + $expected = 'H4sIAAAAAAAAEytJLS4BAAx+f9gEAAAA'; + break; + default: + $expected = 'H4sIAAAAAAAAAytJLS4BAAx+f9gEAAAA'; + } $this->assertEquals($expected, base64_encode($gzip_body)); $this->assertEquals(strlen(gzencode('test')), strlen($gzip_body)); }