public function XssTest::providerTestFilterXssNormalized in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Component/Utility/XssTest.php \Drupal\Tests\Component\Utility\XssTest::providerTestFilterXssNormalized()
Data provider for testFilterXssNormalized().
Return value
array An array of arrays containing strings:
- The value to filter.
- The value to expect after filtering.
- The assertion message.
- (optional) The allowed HTML HTML tags array that should be passed to \Drupal\Component\Utility\Xss::filter().
See also
testFilterXssNormalized()
File
- core/
tests/ Drupal/ Tests/ Component/ Utility/ XssTest.php, line 92
Class
- XssTest
- XSS Filtering tests.
Namespace
Drupal\Tests\Component\UtilityCode
public function providerTestFilterXssNormalized() {
return [
[
"Who's Online",
"who's online",
'HTML filter -- html entity number',
],
[
"Who's Online",
"who's online",
'HTML filter -- encoded html entity number',
],
[
"Who' Online",
"who' online",
'HTML filter -- double encoded html entity number',
],
// Custom elements with dashes in the tag name.
[
"<test-element></test-element>",
"<test-element></test-element>",
'Custom element with dashes in tag name.',
[
'test-element',
],
],
];
}