You are here

public function XssTest::providerTestInvalidMultiByte in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/XssTest.php \Drupal\Tests\Component\Utility\XssTest::providerTestInvalidMultiByte()

Data provider for testInvalidMultiByte().

Return value

array An array of arrays containing strings:

  • The value to filter.
  • The value to expect after filtering.
  • The assertion message.

See also

testInvalidMultiByte()

File

core/tests/Drupal/Tests/Component/Utility/XssTest.php, line 470

Class

XssTest
XSS Filtering tests.

Namespace

Drupal\Tests\Component\Utility

Code

public function providerTestInvalidMultiByte() {
  return [
    [
      "",
      '',
      'Xss::filter() accepted invalid sequence "Foo\\xC0barbaz"',
    ],
    [
      "Fooÿñ",
      "Fooÿñ",
      'Xss::filter() rejects valid sequence Fooÿñ"',
    ],
    [
      "",
      '',
      'HTML filter -- overlong UTF-8 sequences.',
    ],
  ];
}