You are here

public function WebAssert::responseHeaderMatches in Zircon Profile 8

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

Checks that current response header matches regex.

Parameters

string $name:

string $regex:

Throws

ExpectationException

File

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

Class

WebAssert
Mink web assertions tool.

Namespace

Behat\Mink

Code

public function responseHeaderMatches($name, $regex) {
  $actual = $this->session
    ->getResponseHeader($name);
  $message = sprintf('The pattern "%s" was not found anywhere in the "%s" response header.', $regex, $name);
  $this
    ->assert((bool) preg_match($regex, $actual), $message);
}