use PHPUnit\Framework\TestCase;
use Symfony\Component\HtmlSanitizer\HtmlSanitizer;
use Symfony\Component\HtmlSanitizer\HtmlSanitizerConfig;
use Symfony\Component\HtmlSanitizer\Visitor\AttributeSanitizer\AttributeSanitizerInterface;
class HtmlSanitizerCustomTest extends TestCase
{ public function testSanitizeForHead() { $config =
(new HtmlSanitizerConfig()) ->
allowElement('div'
) ;
$this->
assertSame( ' world',
(new HtmlSanitizer($config))->
sanitizeFor('head', '<div style="width: 100px">Hello</div> world'
) );
} public function testSanitizeForTextarea() { $config =
(new HtmlSanitizerConfig())