function WebAssert::pageTextNotContains
Checks that current page does not contain text.
Parameters
string $text:
Return value
void
Throws
File
-
vendor/
behat/ mink/ src/ WebAssert.php, line 305
Class
- WebAssert
- Mink web assertions tool.
Namespace
Behat\MinkCode
public function pageTextNotContains(string $text) {
$actual = $this->session
->getPage()
->getText();
$actual = preg_replace('/\\s+/u', ' ', $actual) ?? $actual;
$regex = '/' . preg_quote($text, '/') . '/ui';
$message = sprintf('The text "%s" appears in the text of this page, but it should not.', $text);
$this->assertResponseText(!preg_match($regex, $actual), $message);
}