Ergo\Tests\Http\ResponseTest::testResponseWithBody PHP Method

testResponseWithBody() public method

    public function testResponseWithBody()
    {
        $headers = array(new Http\HeaderField('Content-Length', 6), new Http\HeaderField('Content-Type', 'text/plain'));
        $response = new Http\Response(200, $headers, 'abcdef');
        $this->assertEquals($response->getStatus()->getCode(), 200);
        $this->assertEquals($response->getHeaders()->value('Content-Length'), 6);
        $this->assertEquals($response->getHeaders()->value('Content-Type'), 'text/plain');
        $this->assertTrue($response->hasBody());
        $this->assertEquals($response->getBody(), 'abcdef');
    }