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 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 );
Original file line number Diff line number Diff line change @@ -835,6 +835,18 @@ public function testGetContentAfterDestruct()
835835 }
836836 }
837837
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+
838850 public function testProxy ()
839851 {
840852 $ client = $ this ->getHttpClient (__FUNCTION__ );
You can’t perform that action at this time.
0 commit comments