function WebAssert::elementTextNotContains
Checks that specific element does not contains text.
Parameters
string $selectorType element selector type (css, xpath):
string|array $selector element selector:
string $text expected text:
Return value
void
Throws
File
-
vendor/
behat/ mink/ src/ WebAssert.php, line 534
Class
- WebAssert
- Mink web assertions tool.
Namespace
Behat\MinkCode
public function elementTextNotContains(string $selectorType, $selector, string $text) {
$element = $this->elementExists($selectorType, $selector);
$actual = $element->getText();
$regex = '/' . preg_quote($text, '/') . '/ui';
$message = sprintf('The text "%s" appears in the text of the %s, but it should not.', $text, $this->getMatchingElementRepresentation($selectorType, $selector));
$this->assertElementText(!preg_match($regex, $actual), $message, $element);
}