lithium\tests\cases\net\http\ResponseTest::testToStringTypeAlwaysUsesContentTypeHeader PHP Метод

testToStringTypeAlwaysUsesContentTypeHeader() публичный Метод

    public function testToStringTypeAlwaysUsesContentTypeHeader()
    {
        $response = new Response();
        $response->headers('Content-Type', 'text/html');
        $expected = "HTTP/1.1 200 OK\r\nContent-Type: text/html;charset=UTF-8\r\n\r\n";
        $result = (string) $response;
        $this->assertEqual($expected, $result);
        $response = new Response();
        $response->headers('Content-Type', 'text/plain');
        $expected = "HTTP/1.1 200 OK\r\nContent-Type: text/plain;charset=UTF-8\r\n\r\n";
        $result = (string) $response;
        $this->assertEqual($expected, $result);
    }