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