You are here

protected function AdminMenuWebTestCase::assertElementByXPath in Administration menu 6.3

Same name and namespace in other branches
  1. 7.3 tests/admin_menu.test \AdminMenuWebTestCase::assertElementByXPath()

Check that an element exists in HTML markup.

Parameters

$xpath: An XPath expression.

array $arguments: (optional) An associative array of XPath replacement tokens to pass to DrupalWebTestCase::buildXPathQuery().

$message: The message to display along with the assertion.

$group: The type of assertion - examples are "Browser", "PHP".

Return value

TRUE if the assertion succeeded, FALSE otherwise.

3 calls to AdminMenuWebTestCase::assertElementByXPath()
AdminMenuDynamicLinksTestCase::testNode in tests/admin_menu.test
Tests node type links.
AdminMenuPermissionsTestCase::testPermissions in tests/admin_menu.test
Test that the links are added to the page (no JS testing).
AdminMenuWebTestCase::assertLinkTrailByTitle in tests/admin_menu.test
Asserts that links appear in the menu in a specified trail.

File

tests/admin_menu.test, line 46
Tests for the Administration menu module.

Class

AdminMenuWebTestCase
Base class for all administration menu web test cases.

Code

protected function assertElementByXPath($xpath, array $arguments = array(), $message, $group = 'Other') {
  $elements = $this
    ->xpath($xpath, $arguments);
  return $this
    ->assertTrue(!empty($elements[0]), $message, $group);
}