Phalcon\Test\FunctionalTestCase::assertResponseCode PHP Method

assertResponseCode() public method

Asserts that the response code matches the given one
public assertResponseCode ( string $expected )
$expected string the expected response code
    public function assertResponseCode($expected)
    {
        // convert to string if int
        if (is_integer($expected)) {
            $expected = (string) $expected;
        }
        $actualValue = $this->di->getShared('response')->getHeaders()->get('Status');
        if (empty($actualValue) || stristr($actualValue, $expected) === false) {
            throw new \PHPUnit_Framework_ExpectationFailedException(sprintf('Failed asserting response code is "%s", actual response status is "%s"', $expected, $actualValue));
        }
        $this->assertContains($expected, $actualValue);
    }