Skip to content

Commit 7664558

Browse files
Merge branch '4.4' into 5.1
* 4.4: Disable the PhpUnit bridge when testing it [PropertyInfo] Support for the mixed type. Don't unset the inflate resource on close as it might still be needed [HttpClient] Fix CurlHttpClient memory leak [Form] Add Bosnian (bs) validators translation [Form] Add missing Serbian (latn & cyrl) validators translation [Cache] skip igbinary < 3.1.6 [Ldap] Bypass the use of `ldap_control_paged_result` on PHP >= 7.3 [Form] [Validator] added pt_BR translations Estonian update [PhpUnitBridge] fix running parallel tests with phpunit 9 [VarDumper] fix truncating big arrays
2 parents f6f1495 + be14879 commit 7664558

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

Test/Fixtures/web/index.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@
6363
header('Content-Type: application/json', true, 404);
6464
break;
6565

66+
case '/404-gzipped':
67+
header('Content-Type: text/plain', true, 404);
68+
ob_start('ob_gzhandler');
69+
echo 'some text';
70+
exit;
71+
6672
case '/301':
6773
if ('Basic Zm9vOmJhcg==' === $vars['HTTP_AUTHORIZATION']) {
6874
header('Location: http://127.0.0.1:8057/302', true, 301);
@@ -157,7 +163,7 @@
157163
exit;
158164

159165
case '/json':
160-
header("Content-Type: application/json");
166+
header('Content-Type: application/json');
161167
echo json_encode([
162168
'documents' => [
163169
['id' => '/json/1'],
@@ -170,7 +176,7 @@
170176
case '/json/1':
171177
case '/json/2':
172178
case '/json/3':
173-
header("Content-Type: application/json");
179+
header('Content-Type: application/json');
174180
echo json_encode([
175181
'title' => $vars['REQUEST_URI'],
176182
]);

Test/HttpClientTestCase.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,18 @@ public function testGetContentAfterDestruct()
860860
}
861861
}
862862

863+
public function testGetEncodedContentAfterDestruct()
864+
{
865+
$client = $this->getHttpClient(__FUNCTION__);
866+
867+
try {
868+
$client->request('GET', 'http://localhost:8057/404-gzipped');
869+
$this->fail(ClientExceptionInterface::class.' expected');
870+
} catch (ClientExceptionInterface $e) {
871+
$this->assertSame('some text', $e->getResponse()->getContent(false));
872+
}
873+
}
874+
863875
public function testProxy()
864876
{
865877
$client = $this->getHttpClient(__FUNCTION__);

0 commit comments

Comments
 (0)