public function assertHeader(array $expected)
{
foreach ($expected as $expectedField => $expectedValue) {
$actualValue = $this->di->getShared('response')->getHeaders()->get($expectedField);
if ($actualValue != $expectedValue) {
throw new \PHPUnit_Framework_ExpectationFailedException(sprintf('Failed asserting "%s" has a value of "%s", actual "%s" header value is "%s"', $expectedField, $expectedValue, $expectedField, $actualValue));
}
$this->assertEquals($expectedValue, $actualValue);
}
}