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