function XssTest::testAttribute
Check that strings in HTML attributes are correctly processed.
@legacy-covers ::attributes
Attributes
#[DataProvider('providerTestAttributes')]
File
- 
              core/tests/ Drupal/ Tests/ Component/ Utility/ XssTest.php, line 494 
Class
- XssTest
- XSS Filtering tests.
Namespace
Drupal\Tests\Component\UtilityCode
public function testAttribute($value, $expected, $message, $allowed_tags = NULL) : void {
  $value = Xss::filter($value, $allowed_tags);
  $this->assertEquals($expected, $value, $message);
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
