lithium\tests\cases\action\ResponseTest::testLocationHeader PHP Метод

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

Tests location headers.
public testLocationHeader ( )
    public function testLocationHeader()
    {
        $this->response = new MockResponse();
        $this->response->status(301);
        $this->response->headers('Location', '/');
        ob_start();
        $this->response->render();
        ob_get_clean();
        $headers = array('HTTP/1.1 301 Moved Permanently', 'Location: /');
        $this->assertEqual($headers, $this->response->testHeaders);
        $this->response = new MockResponse();
        $this->response->headers('Location', '/');
        ob_start();
        $this->response->render();
        ob_get_clean();
        $headers = array('HTTP/1.1 302 Found', 'Location: /');
        $this->assertEqual($headers, $this->response->testHeaders);
        $this->response = new Response(array('classes' => array('router' => __CLASS__), 'location' => array('controller' => 'foo_bar', 'action' => 'index')));
        $this->assertEqual(array('Location: /foo_bar'), $this->response->headers());
    }