/**
* Only testing the first few 2 ranges on this prot. function as that's all these
* other range tests require.
*/
public function testUnicodeCodepointConversionToUtf8(): void
{ $expected = ' ~ޙ';
$codepoints =
[0x20, 0x7E, 0x799
];
$result = '';
foreach ($codepoints as $value) { $result .=
$this->
codepointToUtf8($value);
} static::
assertEquals($expected,
$result);
} public function testJavascriptEscapingEscapesOwaspRecommendedRanges(): void
{ $twig =
new Environment($this->
createMock(LoaderInterface::
class));
$immune =
[',', '.', '_'
]; // Exceptions to escaping ranges
for ($chr = 0;
$chr < 0xFF; ++
$chr) { if ($chr >= 0x30 &&
$chr <= 0x39
||
$chr >= 0x41 &&
$chr <= 0x5A