19 declare(strict_types=1);
36 #[DataProvider('provideTransformData')] 44 $this->expectException(TypeError::class);
50 $this->expectException(ValueError::class);
56 $alpha = implode(
'', range(ord(
'A'), ord(
'z')));
57 $numbers = implode(
'', range(ord(
'0'), ord(
'9')));
59 return array_map(fn($s) => [htmlspecialchars($s, ENT_QUOTES | ENT_SUBSTITUTE,
'utf-8'), $s], [
61 'Single quotes' =>
'\'',
62 'Different quotes' =>
'"Hey, y' .
"'" .
'all"',
63 'Characters beyond ASCII value 255' =>
'Ā',
64 'Characters beyond Unicode BMP' =>
"\xF0\x90\x80\x80",
66 'Immune chars' =>
',.-_',
68 'Numbers' => $numbers,
69 'Basic control characters and null' =>
"\r\n\t\0",
70 'Named entities' =>
'<>&"',
71 'Single space' =>
' ',
72 'Encode entities' =>
'"hello"',
80 '\'' => [
'\'',
'''],
81 '"' => [
'"',
'"'],
84 '&' => [
'&',
'&'],