public function XssTest::testFilterXssNormalized

Tests limiting allowed tags and XSS prevention.

XSS tests assume that script is disallowed by default and src is allowed by default, but on* and style attributes are disallowed.

@dataProvider providerTestFilterXssNormalized

Parameters

string $value: The value to filter.

string $expected: The expected result.

string $message: The assertion message to display upon failure.

File

drupal/core/tests/Drupal/Tests/Component/Utility/XssTest.php, line 74
Contains \Drupal\Tests\Component\Utility\XssTest.

Class

XssTest
Tests the Xss utility.

Namespace

Drupal\Tests\Component\Utility

Code

public function testFilterXssNormalized($value, $expected, $message) {
  $this
    ->assertNormalized(Xss::filter($value), $expected, $message);
}