protected function DrupalWebTestCase::xpath

Perform an xpath search on the contents of the internal browser. The search is relative to the root element (HTML tag normally) of the page.

Parameters

$xpath: The xpath string to use in the search.

Return value

The return value of the xpath search. For details on the xpath string format and return values see the SimpleXML documentation, http://us.php.net/manual/function.simplexml-element-xpath.php.

224 calls to DrupalWebTestCase::xpath()
AggregatorRenderingTestCase::testBlockLinks in drupal-7.x/modules/aggregator/aggregator.test
Adds a feed block to the page and checks its links.
AggregatorRenderingTestCase::testBlockLinks in drupal-7.x/modules/aggregator/aggregator.test
Adds a feed block to the page and checks its links.
AggregatorRenderingTestCase::testFeedPage in drupal-7.x/modules/aggregator/aggregator.test
Creates a feed and checks that feed's page.
AggregatorRenderingTestCase::testFeedPage in drupal-7.x/modules/aggregator/aggregator.test
Creates a feed and checks that feed's page.
AJAXMultiFormTestCase::testMultiForm in drupal-7.x/modules/simpletest/tests/ajax.test
Test that a page with the 'page_node_form' included twice works correctly.

... See full list

Archivo

drupal-7.x/modules/simpletest/drupal_web_test_case.php, line 2528

Class

DrupalWebTestCase
Test case for typical Drupal tests.

Código

protected function xpath($xpath, array $arguments = array()) {
  if ($this->parse()) {
    $xpath = $this->buildXPathQuery($xpath, $arguments);
    $result = $this->elements->xpath($xpath);
    // Some combinations of PHP / libxml versions return an empty array
    // instead of the documented FALSE. Forcefully convert any falsish values
    // to an empty array to allow foreach(...) constructions.
    return $result ? $result : array();
  }
  else {
    return FALSE;
  }
}