protected function AttributeTest::assertNoClass in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::assertNoClass()
- 10 core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::assertNoClass()
Checks that the given CSS class is not 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::assertNoClass()
- 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 396
Class
- AttributeTest
- @coversDefaultClass \Drupal\Core\Template\Attribute @group Template
Namespace
Drupal\Tests\Core\TemplateCode
protected function assertNoClass($class, $html) {
$xpath = "//*[@class='{$class}']";
self::assertFalse((bool) $this
->getXPathResultCount($xpath, $html));
}