public function HtmlTest::testHtmlGetUniqueId in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Component/Utility/HtmlTest.php \Drupal\Tests\Component\Utility\HtmlTest::testHtmlGetUniqueId()
- 9 core/tests/Drupal/Tests/Component/Utility/HtmlTest.php \Drupal\Tests\Component\Utility\HtmlTest::testHtmlGetUniqueId()
Tests the Html::getUniqueId() method.
@dataProvider providerTestHtmlGetUniqueId
@covers ::getUniqueId
Parameters
string $expected: The expected result.
string $source: The string being transformed to an ID.
bool $reset: (optional) If TRUE, reset the list of seen IDs. Defaults to FALSE.
File
- core/
tests/ Drupal/ Tests/ Component/ Utility/ HtmlTest.php, line 116
Class
Namespace
Drupal\Tests\Component\UtilityCode
public function testHtmlGetUniqueId($expected, $source, $reset = FALSE) {
if ($reset) {
Html::resetSeenIds();
}
$this
->assertSame($expected, Html::getUniqueId($source));
}