$this->
assertSame( '<a>Hello world</a>',
$this->
sanitize($config, '<a href="/index.php">Hello world</a>'
) );
} public function testAllowLinksSchemes() { $config =
(new HtmlSanitizerConfig()) ->
allowElement('a',
['href'
]) ->
allowLinkSchemes(['https'
]) ;
$this->
assertSame( '<a href="https://trusted.com">Hello world</a>',
$this->
sanitize($config, '<a href="https://trusted.com">Hello world</a>'
) );
$this->
assertSame( '<a>Hello world</a>',
$this->
sanitize($config, '<a href="mailto:galopintitouan@gmail.com">Hello world</a>'
) );
}