1 link.test | protected LinkBaseTestClass::assertElementByXPath($xpath, array $arguments, $message, $group = 'Other') |
Check that an element exists in HTML markup.
@todo: Consolidate this function with the one provided by admin_bar.test.
Parameters
$xpath: An XPath expression.
array $arguments: 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/ link/ tests/ link.test, line 88 - Link base test file - contains common functions for testing links.
Class
Code
protected function assertElementByXPath($xpath, array $arguments, $message, $group = 'Other') {
$elements = $this->xpath($xpath, $arguments);
return $this->assertTrue(!empty($elements[0]), $message, $group);
}