From c3ca406ab3e930aaf243e970189b145ff5c72e0a Mon Sep 17 00:00:00 2001 From: Igor Solovyov Date: Tue, 5 Jul 2016 14:20:47 +0200 Subject: [PATCH] added step definiton to check response headers --- src/Context/WebApiContext.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Context/WebApiContext.php b/src/Context/WebApiContext.php index fa008df..1541487 100644 --- a/src/Context/WebApiContext.php +++ b/src/Context/WebApiContext.php @@ -285,6 +285,20 @@ public function theResponseShouldContainJson(PyStringNode $jsonString) } } + /** + * Check if the response header has a specific value. + * + * @param string $httpHeader + * @param string $expected + * + * @Then /^the response "([^"]*)" header should be "([^"]*)"$/ + */ + public function theResponseHeaderShouldBe($httpHeader, $expected) + { + $actual = $this->response->getHeaderLine($httpHeader); + Assertions::assertSame($expected, $actual); + } + /** * Prints last response body. *