public function testApiParseResponse_CreatesResponseFromString()
{
$parser = $this->createParser();
$status = 404;
$headers = ['Cache-Control' => 'no-cache, must-revalidate, max-age=0', 'Connection' => 'keep-alive', 'Content-Encoding' => 'gzip', 'Content-Type' => 'text/html; charset=iso-8859-2', 'Date' => 'Tue, 23 Aug 2016 18:27:12 GMT'];
$body = 'text message';
$vers = '1.1';
$rep1 = $this->createResponse($status, $headers, $body, $vers);
$rep2 = $parser->parseResponse($rep1->encode());
$this->assertSame($rep1->getHeaders(), $rep2->getHeaders());
$this->assertSame($rep1->getProtocolVersion(), $rep2->getProtocolVersion());
$this->assertSame($rep1->getStatusCode(), $rep2->getStatusCode());
$this->assertSame($rep1->getReasonPhrase(), $rep2->getReasonPhrase());
$this->assertSame($rep1->read(), $rep2->read());
}