lithium\tests\cases\action\ResponseTest::testStatusCodes PHP Method

testStatusCodes() public method

Tests various methods of specifying HTTP status codes.
public testStatusCodes ( )
    public function testStatusCodes()
    {
        $this->response->status('Created');
        ob_start();
        $this->response->render();
        $result = ob_get_clean();
        $this->assertEqual(array('HTTP/1.1 201 Created'), $this->response->testHeaders);
        $this->response->status('See Other');
        ob_start();
        $this->response->render();
        $result = ob_get_clean();
        $this->assertEqual(array('HTTP/1.1 303 See Other'), $this->response->testHeaders);
        $this->response->status('foobar');
        ob_start();
        $this->response->render();
        $result = ob_get_clean();
        $expected = array('HTTP/1.1 500 Internal Server Error');
        $this->assertEqual($expected, $this->response->testHeaders);
    }