You are here

protected function AdminMenuWebTestCase::assertElementByXPath in Administration menu 7.3

Same name and namespace in other branches
  1. 6.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.

4 calls to AdminMenuWebTestCase::assertElementByXPath()
AdminMenuDynamicLinksTestCase::testNode in tests/admin_menu.test
Tests node type links.
AdminMenuLinkTypesTestCase::testLinkTypes in tests/admin_menu.test
Tests appearance of different router item link types.
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 51
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);
}