You are here

public function AmazonBaseTest::assertElementByXPath in Amazon Product Advertisement API 7.2

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.

2 calls to AmazonBaseTest::assertElementByXPath()
AmazonNodesTest::testFieldFormatters in tests/amazon.nodes.test
Test the field formatters.
AmazonTemplatesTest::testAmazonTemplates in tests/amazon.templates.test
Test the Amazon templates.

File

tests/amazon.base.test, line 62
Base tests for Amazon module.

Class

AmazonBaseTest
@file Base tests for Amazon module.

Code

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