GuzzleHttp\Test\Handler\StreamHandlerTest::testReportsOriginalSizeAndContentEncodingAfterDecoding PHP Method

testReportsOriginalSizeAndContentEncodingAfterDecoding() public method

    public function testReportsOriginalSizeAndContentEncodingAfterDecoding()
    {
        Server::flush();
        $content = gzencode('test');
        Server::enqueue([new Response(200, ['Content-Encoding' => 'gzip', 'Content-Length' => strlen($content)], $content)]);
        $handler = new StreamHandler();
        $request = new Request('GET', Server::$url);
        $response = $handler($request, ['decode_content' => true])->wait();
        $this->assertSame('gzip', $response->getHeaderLine('x-encoded-content-encoding'));
        $this->assertSame(strlen($content), (int) $response->getHeaderLine('x-encoded-content-length'));
    }