protected function WebTestBase::constructFieldXpath

Helper function: construct an XPath for the given set of attributes and value.

Parameters

$attribute: Field attributes.

$value: Value of field.

Return value

XPath for specified values.

9 calls to WebTestBase::constructFieldXpath()

File

drupal/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php, line 3120
Definition of Drupal\simpletest\WebTestBase.

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function constructFieldXpath($attribute, $value) {
  $xpath = '//textarea[@' . $attribute . '=:value]|//input[@' . $attribute . '=:value]|//select[@' . $attribute . '=:value]';
  return $this
    ->buildXPathQuery($xpath, array(
    ':value' => $value,
  ));
}