You are here

protected function AttributeTest::assertID in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::assertID()

Checks that the given CSS ID is present in the given HTML snippet.

Parameters

string $id: The CSS ID to check.

string $html: The HTML snippet to check.

1 call to AttributeTest::assertID()
AttributeTest::testPrint in core/tests/Drupal/Tests/Core/Template/AttributeTest.php
Tests printing of an attribute.

File

core/tests/Drupal/Tests/Core/Template/AttributeTest.php, line 413
Contains \Drupal\Tests\Core\Template\AttributeTest.

Class

AttributeTest
@coversDefaultClass \Drupal\Core\Template\Attribute @group Template

Namespace

Drupal\Tests\Core\Template

Code

protected function assertID($id, $html) {
  $xpath = "//*[@id='{$id}']";
  self::assertTrue((bool) $this
    ->getXPathResultCount($xpath, $html));
}