"\n" => '\\A ',
"\t" => '\\9 ',
"\0" => '\\0 ',
/* Encode spaces for quoteless attribute protection */
' ' => '\\20 ',
];
public function testHtmlEscapingConvertsSpecialChars(): void
{ $twig =
new Environment($this->
createMock(LoaderInterface::
class));
foreach ($this->htmlSpecialChars
as $key =>
$value) { static::
assertEquals($value,
sw_escape_filter($twig,
$key), 'Failed to escape: ' .
$key);
} } public function testHtmlAttributeEscapingConvertsSpecialChars(): void
{ $twig =
new Environment($this->
createMock(LoaderInterface::
class));
foreach ($this->htmlAttrSpecialChars
as $key =>
$value) { static::
assertEquals($value,
sw_escape_filter($twig,
$key, 'html_attr'
), 'Failed to escape: ' .
$key);
} }