$this->
assertSame( '<a href="https://symfony.com">Hello world</a>',
$this->
sanitize($config, '<a href="https://symfony.com">Hello world</a>'
) );
} public function testAllowMediaSchemes() { $config =
(new HtmlSanitizerConfig()) ->
allowElement('img',
['src'
]) ->
allowMediaSchemes(['https'
]) ;
$this->
assertSame( '<img src="https://trusted.com" />',
$this->
sanitize($config, '<img src="https://trusted.com" />'
) );
$this->
assertSame( '<img />',
$this->
sanitize($config, '<img src="http://trusted.com" />'
) );