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()
HandlerTest::testRelationshipUI in drupal/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php
Tests the relationship ui for field/filter/argument/relationship.
ThemeTest::testThemeSettings in drupal/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php
Test the theme settings form.
WebTestBase::assertField in drupal/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
Asserts that a field exists with the given name or id.
WebTestBase::assertFieldById in drupal/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
Asserts that a field exists in the current page with the given id and value.
WebTestBase::assertFieldByName in drupal/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
Asserts that a field exists in the current page with the given name and value.

... See full list

File

drupal/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php, line 2932
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,
  ));
}