You are here

public function WebAssert::responseHeaderNotMatches in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/behat/mink/src/WebAssert.php \Behat\Mink\WebAssert::responseHeaderNotMatches()

Checks that current response header does not match regex.

Parameters

string $name:

string $regex:

Throws

ExpectationException

File

vendor/behat/mink/src/WebAssert.php, line 236

Class

WebAssert
Mink web assertions tool.

Namespace

Behat\Mink

Code

public function responseHeaderNotMatches($name, $regex) {
  $actual = $this->session
    ->getResponseHeader($name);
  $message = sprintf('The pattern "%s" was found in the text of the "%s" response header, but it should not.', $regex, $name);
  $this
    ->assert(!preg_match($regex, $actual), $message);
}