19 declare(strict_types=1);
    34         vfsStreamWrapper::register();
    35         $root = vfsStreamWrapper::setRoot(
new vfsStreamDirectory(
'root'));
    36         $cache_directory = vfsStream::newDirectory(
'HTMLPurifier')->at($root);
    37         $cache_directory->chmod(0777);
    39         $this->assertInstanceOf(HTMLPurifier::class, 
new HTMLPurifier([], vfsStream::url(
'root/HTMLPurifier')));
    45     public function testPurify(
string $input, 
string $expected): void
    48         vfsStreamWrapper::register();
    49         $root = vfsStreamWrapper::setRoot(
new vfsStreamDirectory(
'root'));
    50         $cache_directory = vfsStream::newDirectory(
'HTMLPurifier')->at($root);
    51         $cache_directory->chmod(0777);
    54                 'a', 
'blockquote', 
'br', 
'cite', 
'code', 
'dd', 
'div', 
'dl', 
'dt', 
'em', 
'h1', 
'h2', 
'h3', 
'h4',
    55                 'h5', 
'h6', 
'hr', 
'img', 
'li', 
'ol', 
'p', 
'pre', 
'span', 
'strong', 
'sub', 
'sup', 
'u', 
'ul',
    56             ], vfsStream::url(
'root/HTMLPurifier'));
    58         $this->assertSame($expected, $instance->purify($input));
    64             'Simple HTML Elements' => [
    65                 '<h1><b>This</b> <i>is</i> <u>a</u> <em>Headline</em>!</h1><p>And a<br>paragraph.</p>',
    66                 '<h1><b>This</b> <i>is</i> <span style="text-decoration:underline;">a</span> <em>Headline</em>!</h1><p>And a<br />paragraph.</p>',
    68             'Simple HTML Elements with an Invalid Tag' => [
    69                 '<h1>This is a <a href="mailto:info@ilias.de">Headline</a>!</h1><p>And a paragraph with an invalid element: ILIAS e.V. <info@ilias.de>.</p>',
    70                 '<h1>This is a <a href="mailto:info@ilias.de">Headline</a>!</h1><p>And a paragraph with an invalid element: ILIAS e.V. .</p>',
    72             'Block Elements and Nested Lists' => [
    73                 '<div><ul><li>Php</li></ul><hr><ol><li>Unit</li></ol><dl><dt>Test</dt><dd><code>Success or Failure!</code></dd></dl></div>',
    74                 '<div><ul><li>Php</li></ul><hr /><ol><li>Unit</li></ol><dl><dt>Test</dt><dd><code>Success or Failure!</code></dd></dl></div>',
    77                 '<pre>Text</pre><blockquote><cite><sup>Q</sup>uote</cite></blockquote>',
    78                 '<pre>Text</pre><blockquote><p><cite><sup>Q</sup>uote</cite></p></blockquote>',
    85         return class_exists(
'org\bovigo\vfs\vfsStreamWrapper');
    91             $this->markTestSkipped(
'Skipped test, vfsStream (https://github.com/bovigo/vfsStream) required');
 
skipIfvfsStreamNotSupported()
 
testPurify(string $input, string $expected)
documents