diff --git a/src/Context/WebApiContext.php b/src/Context/WebApiContext.php index fa008df..7b79cf1 100644 --- a/src/Context/WebApiContext.php +++ b/src/Context/WebApiContext.php @@ -222,6 +222,19 @@ public function theResponseCodeShouldBe($code) Assertions::assertSame($expected, $actual); } + /** + * Checks that the response has specific header key/value + * + * @param string $key header key + * @param string $value header value + * + * @Then the response header :key should be :value + */ + public function theResponseHeaderShouldBe($key, $value) + { + Assertions::assertSame($value, $this->response->getHeader($key)[0]); + } + /** * Checks that response body contains specific text. *