diff --git a/src/Behat/MinkExtension/Context/MinkContext.php b/src/Behat/MinkExtension/Context/MinkContext.php index 90ea0380..9e4b78af 100644 --- a/src/Behat/MinkExtension/Context/MinkContext.php +++ b/src/Behat/MinkExtension/Context/MinkContext.php @@ -236,6 +236,66 @@ public function assertResponseStatusIsNot($code) $this->assertSession()->statusCodeNotEquals($code); } + /** + * Checks, that current page response header is equal to specified. + * + * @Then /^the response header "(?P(?:[^"]|\\")*)" should be "(?P(?:[^"]|\\")*)"$/ + */ + public function assertResponseHeader($name, $value) + { + $this->assertSession()->responseHeaderEquals($name, $value); + } + + /** + * Checks, that current page response header is not equal to specified. + * + * @Then /^the response header "(?P(?:[^"]|\\")*)" should not be "(?P(?:[^"]|\\")*)"$/ + */ + public function assertResponseHeaderIsNot($name, $value) + { + $this->assertSession()->responseHeaderNotEquals($name, $value); + } + + /** + * Checks, that current page response header contains specified value. + * + * @Then /^the response header "(?P(?:[^"]|\\")*)" should contain "(?P(?:[^"]|\\")*)"$/ + */ + public function assertResponseHeaderContains($name, $value) + { + $this->assertSession()->responseHeaderContains($name, $value); + } + + /** + * Checks, that current page response header does not contain specified value. + * + * @Then /^the response header "(?P(?:[^"]|\\")*)" should not contain "(?P(?:[^"]|\\")*)"$/ + */ + public function assertResponseHeaderNotContains($name, $value) + { + $this->assertSession()->responseHeaderNotContains($name, $value); + } + + /** + * Checks, that current page response header is equal to specified. + * + * @Then /^the response header "(?P(?:[^"]|\\")*)" should match "(?P(?:[^"]|\\")*)"$/ + */ + public function assertResponseHeaderMatches($name, $value) + { + $this->assertSession()->responseHeaderMatches($name, $value); + } + + /** + * Checks, that current page response header is not equal to specified. + * + * @Then /^the response header "(?P(?:[^"]|\\")*)" should not match "(?P(?:[^"]|\\")*)"$/ + */ + public function assertResponseHeaderNotMatches($name, $value) + { + $this->assertSession()->responseHeaderNotMatches($name, $value); + } + /** * Checks, that page contains specified text. *