Data provider for testCheckPlain().
testCheckPlain()
function providerCheckPlain() {
// Checks that invalid multi-byte sequences are rejected.
$tests[] = array(
"",
'',
'String::checkPlain() rejects invalid sequence "Foo\\xC0barbaz"',
TRUE,
);
$tests[] = array(
"",
'',
'String::checkPlain() rejects invalid sequence "\\xc2\\""',
TRUE,
);
$tests[] = array(
"Fooÿñ",
"Fooÿñ",
'String::checkPlain() accepts valid sequence "Fooÿñ"',
);
// Checks that special characters are escaped.
$tests[] = array(
"<script>",
'<script>',
'String::checkPlain() escapes <script>',
);
$tests[] = array(
'<>&"\'',
'<>&"'',
'String::checkPlain() escapes reserved HTML characters.',
);
return $tests;
}