public function assertStatusCode($expected, \Congow\Orient\Http\Response $got) { $message = "The status code of the response is wrong"; return $this->assertEquals($expected, $got->getStatusCode(), $got->getBody()); }
public function testGettingTheStatusCode() { $response = new Http\Response("HTTP/1.1 200 OK\r\nCache-Control: max-age=30\r\nCache-Control: s-maxage=50\r\n\r\n"); $this->assertEquals("200", $response->getStatusCode()); }
/** * Checks whether the $response is valid. * A response is *not* considere valid when: * * it's void * * it returns a status code different from 2XX * * @param Response $response */ protected function checkResponse(Response $response = null) { if (!$response) { throw new VoidResponse(get_class($this->getClient()), $sql); } if (!in_array($response->getStatusCode(), $response->getValidStatusCodes())) { throw new InvalidSQL($response); } }