예제 #1
0
 /**
  * @Then /^the response header "(.*)" should be "(.*)"$/
  */
 public function checkResponseHeader($name, $expectedValue)
 {
     $value = f\get_or($this->response->getHeaders(), $name, null);
     if ($value !== $expectedValue) {
         throw new Exception(sprintf('The response header "%s" is "%s" and it should be "%s".', $name, $value, $expectedValue));
     }
 }
예제 #2
0
 public function testResponse()
 {
     $statusCode = '204';
     $content = 'foo';
     $headers = array('foo' => 'bar');
     $response = new Response($statusCode, $content, $headers);
     $this->assertSame($statusCode, $response->getStatusCode());
     $this->assertSame($content, $response->getContent());
     $this->assertSame($headers, $response->getHeaders());
 }