Skip to content
Permalink
Browse files

Added assertHeaderContains

  • Loading branch information...
half2me committed Feb 8, 2016
1 parent 4c3cc0b commit 4b31ef17fb754b424f43d9d6bcf3b233e028fa7b
Showing with 20 additions and 0 deletions.
  1. +20 −0 src/TestSuite/IntegrationTestCase.php
@@ -682,6 +682,26 @@ public function assertHeader($header, $content, $message = '')
}
$this->assertEquals($headers[$header], $content, $message);
}
/**
* Asserts response header contains a string
*
* @param string $header The header to check
* @param string $content The content to check for.
* @param string $message The failure message that will be appended to the generated message.
* @return void
*/
public function assertHeaderContains($header, $content, $message = '')
{
if (!$this->_response) {
$this->fail('No response set, cannot assert headers. ' . $message);
}
$headers = $this->_response->header();
if (!isset($headers[$header])) {
$this->fail("The '$header' header is not set. " . $message);
}
$this->assertContains($content, $headers[$header], $message);
}
/**
* Asserts content type

0 comments on commit 4b31ef1

Please sign in to comment.
You can’t perform that action at this time.