function HtmlTest::testCleanCssIdentifier
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Component/Utility/HtmlTest.php \Drupal\Tests\Component\Utility\HtmlTest::testCleanCssIdentifier()
- 10 core/tests/Drupal/Tests/Component/Utility/HtmlTest.php \Drupal\Tests\Component\Utility\HtmlTest::testCleanCssIdentifier()
- 11.x core/tests/Drupal/Tests/Component/Utility/HtmlTest.php \Drupal\Tests\Component\Utility\HtmlTest::testCleanCssIdentifier()
Tests the Html::cleanCssIdentifier() method.
@dataProvider providerTestCleanCssIdentifier
@covers ::cleanCssIdentifier
Parameters
string $expected: The expected result.
string $source: The string being transformed to an ID.
array|null $filter: (optional) An array of string replacements to use on the identifier. If NULL, no filter will be passed and a default will be used.
File
-
core/
tests/ Drupal/ Tests/ Component/ Utility/ HtmlTest.php, line 49
Class
Namespace
Drupal\Tests\Component\UtilityCode
public function testCleanCssIdentifier($expected, $source, $filter = NULL) {
if ($filter !== NULL) {
$this->assertSame($expected, Html::cleanCssIdentifier($source, $filter));
}
else {
$this->assertSame($expected, Html::cleanCssIdentifier($source));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.