You are here

public function WebAssert::responseNotMatches in Zircon Profile 8.0

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

Checks that page HTML (response content) does not matches regex.

Parameters

$regex:

Throws

ExpectationException

File

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

Class

WebAssert
Mink web assertions tool.

Namespace

Behat\Mink

Code

public function responseNotMatches($regex) {
  $actual = $this->session
    ->getPage()
    ->getContent();
  $message = sprintf('The pattern %s was found in the HTML response of the page, but it should not.', $regex);
  $this
    ->assert(!preg_match($regex, $actual), $message);
}