protected function AttributeTest::assertClass in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::assertClass()
Checks that the given CSS class is present in the given HTML snippet.
Parameters
string $class: The CSS class to check.
string $html: The HTML snippet to check.
1 call to AttributeTest::assertClass()
- 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 386
Class
- AttributeTest
- @coversDefaultClass \Drupal\Core\Template\Attribute @group Template
Namespace
Drupal\Tests\Core\TemplateCode
protected function assertClass($class, $html) {
$xpath = "//*[@class='{$class}']";
self::assertTrue((bool) $this
->getXPathResultCount($xpath, $html));
}