1 admin_bar.test protected AdminBarWebTestCase::assertElementByXPath($xpath, array $arguments = array(), $message, $group = 'Other')

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 BackdropWebTestCase::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.:

File

core/modules/admin_bar/tests/admin_bar.test, line 45
Tests for the Administration bar module.

Class

AdminBarWebTestCase
Base class for all administration bar 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);
}