You are here

protected function DrupalWebTestCase::constructFieldXpath in SimpleTest 6.2

Same name and namespace in other branches
  1. 7.2 drupal_web_test_case.php \DrupalWebTestCase::constructFieldXpath()
  2. 7 drupal_web_test_case.php \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.

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

... See full list

File

./drupal_web_test_case.php, line 2964

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