You are here

protected function DrupalWebTestCase::constructFieldXpath in Drupal 7

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 modules/simpletest/drupal_web_test_case.php
Asserts that a field exists with the given name or ID.
DrupalWebTestCase::assertFieldById in 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 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 modules/simpletest/drupal_web_test_case.php
Asserts that a field does not exist with the given name or ID.
DrupalWebTestCase::assertNoFieldById in modules/simpletest/drupal_web_test_case.php
Asserts that a field does not exist with the given ID and value.

... See full list

File

modules/simpletest/drupal_web_test_case.php, line 3857

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,
  ));
}