You are here

public function XssTest::providerTestInvalidMultiByte in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 475
Contains \Drupal\Tests\Component\Utility\XssTest.

Class

XssTest
XSS Filtering tests.

Namespace

Drupal\Tests\Component\Utility

Code

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