You are here

protected function AttributeTest::assertNoClass in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::assertNoClass()
  2. 9 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.

@internal

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 403

Class

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

Namespace

Drupal\Tests\Core\Template

Code

protected function assertNoClass(string $class, string $html) : void {
  $xpath = "//*[@class='{$class}']";
  self::assertFalse((bool) $this
    ->getXPathResultCount($xpath, $html));
}