19 declare(strict_types=1);
31 return class_exists(
'org\bovigo\vfs\vfsStreamWrapper');
37 $this->markTestSkipped(
'Skipped test, vfsStream (https://github.com/bovigo/vfsStream) required');
44 'Simple HTML Elements' => [
45 '<h1><b>This</b> <i>is</i> <u>a</u> <em>Headline</em>!</h1><p>And a<br>paragraph.</p>',
46 '<h1><b>This</b> <i>is</i> <span style="text-decoration:underline;">a</span> <em>Headline</em>!</h1><p>And a<br />paragraph.</p>',
48 'Simple HTML Elements with an Invalid Tag' => [
49 '<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>',
50 '<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>',
52 'Block Elements and Nested Lists' => [
53 '<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>',
54 '<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>',
57 '<pre>Text</pre><blockquote><cite><sup>Q</sup>uote</cite></blockquote>',
58 '<pre>Text</pre><blockquote><p><cite><sup>Q</sup>uote</cite></p></blockquote>',
72 vfs\vfsStreamWrapper::register();
73 $root = vfs\vfsStreamWrapper::setRoot(
new vfs\vfsStreamDirectory(
'root'));
74 $cacheDirectory = vfs\vfsStream::newDirectory(
'HTMLPurifier')->at($root);
75 $cacheDirectory->chmod(0777);
108 vfs\vfsStream::url(
'root/HTMLPurifier')
110 $this->assertSame($expected, $purifier->purify($text));
Class ilTermsOfServiceCriterionBaseTest.
testPurifyingWorksAsExpected(string $text, string $expected)
documentTextProvider
Class ilTermsOfServiceDocumentHtmlPurifier.
Class ilTermsOfServiceDocumentHtmlPurifierTest.
skipIfvfsStreamNotSupported()