Definition at line 30 of file HTMLPurifierTest.php.
◆ documents()
static ILIAS\LegalDocuments\test\HTMLPurifierTest::documents |
( |
| ) |
|
|
static |
Definition at line 60 of file HTMLPurifierTest.php.
63 'Simple HTML Elements' => [
64 '<h1><b>This</b> <i>is</i> <u>a</u> <em>Headline</em>!</h1><p>And a<br>paragraph.</p>',
65 '<h1><b>This</b> <i>is</i> <span style="text-decoration:underline;">a</span> <em>Headline</em>!</h1><p>And a<br />paragraph.</p>',
67 'Simple HTML Elements with an Invalid Tag' => [
68 '<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>',
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. .</p>',
71 'Block Elements and Nested Lists' => [
72 '<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>',
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>',
76 '<pre>Text</pre><blockquote><cite><sup>Q</sup>uote</cite></blockquote>',
77 '<pre>Text</pre><blockquote><p><cite><sup>Q</sup>uote</cite></p></blockquote>',
◆ isVsfStreamInstalled()
ILIAS\LegalDocuments\test\HTMLPurifierTest::isVsfStreamInstalled |
( |
| ) |
|
|
private |
◆ skipIfvfsStreamNotSupported()
ILIAS\LegalDocuments\test\HTMLPurifierTest::skipIfvfsStreamNotSupported |
( |
| ) |
|
|
private |
◆ testConstruct()
ILIAS\LegalDocuments\test\HTMLPurifierTest::testConstruct |
( |
| ) |
|
Definition at line 32 of file HTMLPurifierTest.php.
References ILIAS\LegalDocuments\test\HTMLPurifierTest\skipIfvfsStreamNotSupported().
35 vfsStreamWrapper::register();
36 $root = vfsStreamWrapper::setRoot(
new vfsStreamDirectory(
'root'));
37 $cache_directory = vfsStream::newDirectory(
'HTMLPurifier')->at($root);
38 $cache_directory->chmod(0777);
40 $this->assertInstanceOf(HTMLPurifier::class,
new HTMLPurifier([], vfsStream::url(
'root/HTMLPurifier')));
skipIfvfsStreamNotSupported()
◆ testPurify()
ILIAS\LegalDocuments\test\HTMLPurifierTest::testPurify |
( |
string |
$input, |
|
|
string |
$expected |
|
) |
| |
Definition at line 44 of file HTMLPurifierTest.php.
References ILIAS\LegalDocuments\test\HTMLPurifierTest\skipIfvfsStreamNotSupported().
47 vfsStreamWrapper::register();
48 $root = vfsStreamWrapper::setRoot(
new vfsStreamDirectory(
'root'));
49 $cache_directory = vfsStream::newDirectory(
'HTMLPurifier')->at($root);
50 $cache_directory->chmod(0777);
52 $instance =
new HTMLPurifier([
53 'a',
'blockquote',
'br',
'cite',
'code',
'dd',
'div',
'dl',
'dt',
'em',
'h1',
'h2',
'h3',
'h4',
54 'h5',
'h6',
'hr',
'img',
'li',
'ol',
'p',
'pre',
'span',
'strong',
'sub',
'sup',
'u',
'ul',
55 ], vfsStream::url(
'root/HTMLPurifier'));
57 $this->assertSame($expected, $instance->purify($input));
skipIfvfsStreamNotSupported()
The documentation for this class was generated from the following file: