PhlyTest\Http\Response\SerializerTest::testCanDeserializeBasicResponse PHP Method

testCanDeserializeBasicResponse() public method

    public function testCanDeserializeBasicResponse()
    {
        $text = "HTTP/1.0 200 A-OK\r\nContent-Type: text/plain\r\nX-Foo-Bar: Baz\r\n\r\nContent!";
        $response = Serializer::fromString($text);
        $this->assertInstanceOf('Psr\\Http\\Message\\ResponseInterface', $response);
        $this->assertInstanceOf('Phly\\Http\\Response', $response);
        $this->assertEquals('1.0', $response->getProtocolVersion());
        $this->assertEquals(200, $response->getStatusCode());
        $this->assertEquals('A-OK', $response->getReasonPhrase());
        $this->assertTrue($response->hasHeader('Content-Type'));
        $this->assertEquals('text/plain', $response->getHeaderLine('Content-Type'));
        $this->assertTrue($response->hasHeader('X-Foo-Bar'));
        $this->assertEquals('Baz', $response->getHeaderLine('X-Foo-Bar'));
        $this->assertEquals('Content!', (string) $response->getBody());
    }