Beispiel #1
0
 /**
  * @return array
  */
 public function toArray()
 {
     return ['method' => $this->request->getMethod(), 'uri' => $this->request->getUriString(), 'responseCode' => $this->response->getStatusCode(), 'execution_time' => $this->endTime - $_SERVER['REQUEST_TIME_FLOAT'], 'timers' => $this->timersReport];
 }
Beispiel #2
0
 /**
  * Test that response has specific status code
  * 
  * @param integer $code
  * @param string $message
  */
 protected function assertResponseStatusCode($code, $message = null)
 {
     $this->assertResponse();
     $this->assertEquals($code, $this->response->getStatusCode(), $message);
 }
Beispiel #3
0
 /**
  * Asserts that the provided response code matches the one resulting from the most recent dispatch.
  *
  * @param  integer $code    The HTTP response code.
  * @param  string  $message (Optional) The message to output on failure.
  * @return void
  */
 public function assertResponseCode($code, $message = '')
 {
     $actualCode = !empty($this->response) ? $this->response->getStatusCode() : null;
     $this->assertSame($code, $actualCode, $message);
 }