You are here

public function WebAssert::elementAttributeExists in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink/src/WebAssert.php \Behat\Mink\WebAssert::elementAttributeExists()

Checks that an attribute exists in an element.

Parameters

string $selectorType:

string|array $selector:

string $attribute:

Return value

NodeElement

Throws

ElementHtmlException

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 555

Class

WebAssert
Mink web assertions tool.

Namespace

Behat\Mink

Code

public function elementAttributeExists($selectorType, $selector, $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;
}