function WebAssert::elementAttributeNotContains
Checks that an attribute of a specific elements does not contain text.
Parameters
string $selectorType:
string|array $selector:
string $attribute:
string $text:
Return value
void
Throws
File
-
vendor/
behat/ mink/ src/ WebAssert.php, line 699
Class
- WebAssert
- Mink web assertions tool.
Namespace
Behat\MinkCode
public function elementAttributeNotContains(string $selectorType, $selector, string $attribute, string $text) {
$element = $this->elementAttributeExists($selectorType, $selector, $attribute);
$actual = (string) $element->getAttribute($attribute);
$regex = '/' . preg_quote($text, '/') . '/ui';
$message = sprintf('The text "%s" was found in the attribute "%s" of the %s.', $text, $attribute, $this->getMatchingElementRepresentation($selectorType, $selector));
$this->assertElement(!preg_match($regex, $actual), $message, $element);
}