/** * Checks if the actual http status equals the expected. * * @see LiveTest\TestCase.HttpTestCase::test() */ public function test(Response $response, Request $request) { $status = $response->getStatus(); if ($status != $this->statusCode) { throw new Exception('The http status code ' . $status . ' was found, expected code was ' . $this->statusCode); } }
/** * This function checks if the status code is < 400 * * @see LiveTest\TestCase.HttpTestCase::test() */ public function test(Response $response, Request $request) { $status = (int) $response->getStatus(); if ($status >= 400) { throw new Exception('The http status code ' . $status . ' was found (<400 expected).'); } }