File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 63
63
header ('Content-Type: application/json ' , true , 404 );
64
64
break ;
65
65
66
+ case '/404-gzipped ' :
67
+ header ('Content-Type: text/plain ' , true , 404 );
68
+ ob_start ('ob_gzhandler ' );
69
+ echo 'some text ' ;
70
+ exit ;
71
+
66
72
case '/301 ' :
67
73
if ('Basic Zm9vOmJhcg== ' === $ vars ['HTTP_AUTHORIZATION ' ]) {
68
74
header ('Location: http://127.0.0.1:8057/302 ' , true , 301 );
Original file line number Diff line number Diff line change @@ -835,6 +835,18 @@ public function testGetContentAfterDestruct()
835
835
}
836
836
}
837
837
838
+ public function testGetEncodedContentAfterDestruct ()
839
+ {
840
+ $ client = $ this ->getHttpClient (__FUNCTION__ );
841
+
842
+ try {
843
+ $ client ->request ('GET ' , 'http://localhost:8057/404-gzipped ' );
844
+ $ this ->fail (ClientExceptionInterface::class.' expected ' );
845
+ } catch (ClientExceptionInterface $ e ) {
846
+ $ this ->assertSame ('some text ' , $ e ->getResponse ()->getContent (false ));
847
+ }
848
+ }
849
+
838
850
public function testProxy ()
839
851
{
840
852
$ client = $ this ->getHttpClient (__FUNCTION__ );
You can’t perform that action at this time.
0 commit comments