protected function DrupalWebTestCase::constructFieldXpath
7.x drupal_web_test_case.php | protected DrupalWebTestCase::constructFieldXpath($attribute, $value) |
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-7.x/
modules/ simpletest/ drupal_web_test_case.php - Asserts that a field exists with the given name or id.
- DrupalWebTestCase::assertFieldById in drupal-7.x/
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-7.x/
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-7.x/
modules/ simpletest/ drupal_web_test_case.php - Asserts that a field does not exist with the given name or id.
- DrupalWebTestCase::assertNoFieldById in drupal-7.x/
modules/ simpletest/ drupal_web_test_case.php - Asserts that a field does not exist with the given id and value.
File
- drupal-7.x/
modules/ simpletest/ drupal_web_test_case.php, line 3536
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));
}