You are here

protected function SharerichTests::assertElementByXPath in Sharerich 8

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 SharerichTests::assertElementByXPath()
SharerichTests::testBlock in tests/src/Functional/SharerichTests.php
Test sharerich block.

File

tests/src/Functional/SharerichTests.php, line 86

Class

SharerichTests
Sharerich tests.

Namespace

Drupal\Tests\sharerich\Functional

Code

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