function WebAssert::elementAttributeExists
Checks that an attribute exists in an element.
Parameters
string $selectorType:
string|array $selector:
string $attribute:
Return value
Throws
2 calls to WebAssert::elementAttributeExists()
- WebAssert::elementAttributeContains in vendor/
behat/ mink/ src/ WebAssert.php - Checks that an attribute of a specific elements contains text.
- WebAssert::elementAttributeNotContains in vendor/
behat/ mink/ src/ WebAssert.php - Checks that an attribute of a specific elements does not contain text.
File
-
vendor/
behat/ mink/ src/ WebAssert.php, line 615
Class
- WebAssert
- Mink web assertions tool.
Namespace
Behat\MinkCode
public function elementAttributeExists(string $selectorType, $selector, string $attribute) {
$element = $this->elementExists($selectorType, $selector);
$message = sprintf('The attribute "%s" was not found in the %s.', $attribute, $this->getMatchingElementRepresentation($selectorType, $selector));
$this->assertElement($element->hasAttribute($attribute), $message, $element);
return $element;
}