protected function DrupalWebTestCase::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.

7 calls to DrupalWebTestCase::constructFieldXpath()
DrupalWebTestCase::assertField in drupal/modules/simpletest/drupal_web_test_case.php
Asserts that a field exists with the given name or ID.
DrupalWebTestCase::assertFieldById in drupal/modules/simpletest/drupal_web_test_case.php
Asserts that a field exists in the current page with the given ID and value.
DrupalWebTestCase::assertFieldByName in drupal/modules/simpletest/drupal_web_test_case.php
Asserts that a field exists in the current page with the given name and value.
DrupalWebTestCase::assertNoField in drupal/modules/simpletest/drupal_web_test_case.php
Asserts that a field does not exist with the given name or ID.
DrupalWebTestCase::assertNoFieldById in drupal/modules/simpletest/drupal_web_test_case.php
Asserts that a field does not exist with the given ID and value.

... See full list

File

drupal/modules/simpletest/drupal_web_test_case.php, line 3636

Class

DrupalWebTestCase
Test case for typical Drupal tests.

Code

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