public function WebAssert::responseMatches in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/behat/mink/src/WebAssert.php \Behat\Mink\WebAssert::responseMatches()
Checks that page HTML (response content) matches regex.
Parameters
string $regex:
Throws
File
- vendor/
behat/ mink/ src/ WebAssert.php, line 351
Class
- WebAssert
- Mink web assertions tool.
Namespace
Behat\MinkCode
public function responseMatches($regex) {
$actual = $this->session
->getPage()
->getContent();
$message = sprintf('The pattern %s was not found anywhere in the HTML response of the page.', $regex);
$this
->assert((bool) preg_match($regex, $actual), $message);
}