$this->
assertSame( '<a>Hello world</a>',
$this->
sanitize($config, '<a href="https://untrusted.com">Hello world</a>'
) );
} public function testAllowLinksRelative() { $config =
(new HtmlSanitizerConfig()) ->
allowElement('a',
['href'
]) ->
allowRelativeLinks() ;
$this->
assertSame( '<a href="/index.php">Hello world</a>',
$this->
sanitize($config, '<a href="/index.php">Hello world</a>'
) );
$this->
assertSame( '<a href="https://symfony.com">Hello world</a>',
$this->
sanitize($config, '<a href="https://symfony.com">Hello world</a>'
) );
}