$this->
assertSame( '<div>Hello</div> world',
$this->
sanitize($config, '<div style="width: 100px">Hello</div> world'
) );
} public function testForceHttps() { $config =
(new HtmlSanitizerConfig()) ->
allowElement('a',
['href'
]) ->
forceHttpsUrls() ;
$this->
assertSame( '<a href="https://symfony.com">Hello world</a>',
$this->
sanitize($config, '<a href="http://symfony.com">Hello world</a>'
) );
$this->
assertSame( '<a href="https://symfony.com">Hello world</a>',
$this->
sanitize($config, '<a href="https://symfony.com">Hello world</a>'
) );