function HtmlTest::testHtmlGetId
Same name and namespace in other branches
- 10 core/tests/Drupal/Tests/Component/Utility/HtmlTest.php \Drupal\Tests\Component\Utility\HtmlTest::testHtmlGetId()
- 9 core/tests/Drupal/Tests/Component/Utility/HtmlTest.php \Drupal\Tests\Component\Utility\HtmlTest::testHtmlGetId()
- 8.9.x core/tests/Drupal/Tests/Component/Utility/HtmlTest.php \Drupal\Tests\Component\Utility\HtmlTest::testHtmlGetId()
Tests the Html::getUniqueId() method.
@legacy-covers ::getId
Attributes
#[DataProvider('providerTestHtmlGetId')]
Parameters
string $expected: The expected result.
string $source: The string being transformed to an ID.
File
-
core/
tests/ Drupal/ Tests/ Component/ Utility/ HtmlTest.php, line 205
Class
Namespace
Drupal\Tests\Component\UtilityCode
public function testHtmlGetId($expected, $source) : void {
Html::setIsAjax(FALSE);
$this->assertSame($expected, Html::getId($source));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.