You are here

protected function SharerichTest::assertElementByXPath in Sharerich 7.3

Same name and namespace in other branches
  1. 7.2 tests/sharerich.test \SharerichTest::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.

1 call to SharerichTest::assertElementByXPath()
SharerichTest::testBlock in tests/sharerich.test
Test sharerich block.

File

tests/sharerich.test, line 90

Class

SharerichTest
Sharerich tests.

Code

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