Horde_Http_TestBase::testRequest PHP Method

testRequest() public method

public testRequest ( )
    public function testRequest()
    {
        $this->_skipMissingConfig();
        $client = new Horde_Http_Client(array('request' => new self::$_requestClass()));
        $response = $client->get('http://' . $this->_server);
        $this->assertStringStartsWith('http', $response->uri);
        $this->assertStringStartsWith('1.', $response->httpVersion);
        $this->assertEquals(200, $response->code);
        $this->assertInternalType('array', $response->headers);
        $this->assertInternalType('string', $response->getBody());
        $this->assertGreaterThan(0, strlen($response->getBody()));
        $this->assertInternalType('resource', $response->getStream());
        $this->assertStringMatchesFormat('%s/%s', $response->getHeader('Content-Type'));
        $this->assertEquals($response->getHeader('content-type'), $response->getHeader('Content-Type'));
        $this->assertArrayHasKey('content-type', $response->headers);
        $this->assertEquals($response->getHeader('content-type'), $response->headers['content-type']);
    }