ILIAS
release_9 Revision v9.13-25-g2c18ec4c24f
◀ ilDoc Overview
ValidHTMLTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\LegalDocuments\test
;
22
23
use
PHPUnit\Framework\TestCase
;
24
use
ILIAS\LegalDocuments\ValidHTML
;
25
26
class
ValidHTMLTest
extends
TestCase
27
{
28
public
function
testConstruct
(): void
29
{
30
$this->assertInstanceOf(ValidHTML::class,
new
ValidHTML
());
31
}
32
38
public
function
testIsTrue
(
string
$text,
bool
$result): void
39
{
40
$instance =
new
ValidHTML
();
41
$this->assertSame($result, $instance->isTrue($text));
42
}
43
44
public
function
textProvider
(): array
45
{
46
return
[
47
'Plain Text'
=> [
'phpunit'
,
false
],
48
'HTML Fragment'
=> [
'php<b>unit</b>'
,
true
],
49
'HTML Fragment with Email Address Wrapped in <>'
=> [
'php<b>unit</b> <info@ilias.de>'
,
false
],
50
'HTML'
=> [
'<html><body>php<b>unit</b></body></html>'
,
true
],
51
'HTML with Email Address Wrapped in <>'
=> [
'<html><body>php<b>unit</b>Php Unit <info@ilias.de></body></html>'
,
false
],
52
'HTML with Unsupported Entities'
=> [
'<html><body>php<b>unit</b>Php Unit<figure></figure></body></html>'
,
true
],
53
'Invalid HTML'
=> [
'<html><body>php<b>unit</b>Php Unit<div </body></html>'
,
false
],
54
];
55
}
56
}
ILIAS\LegalDocuments\ValidHTML
Definition:
ValidHTML.php:30
ILIAS\LegalDocuments\test\ValidHTMLTest
Definition:
ValidHTMLTest.php:26
ILIAS\LegalDocuments\test
Definition:
AdministrationEditLinksTest.php:21
ValidHTML
ILIAS\LegalDocuments\test\ValidHTMLTest\testIsTrue
testIsTrue(string $text, bool $result)
textProvider
Definition:
ValidHTMLTest.php:38
ILIAS\LegalDocuments\test\ValidHTMLTest\textProvider
textProvider()
Definition:
ValidHTMLTest.php:44
TestCase
ILIAS\LegalDocuments\test\ValidHTMLTest\testConstruct
testConstruct()
Definition:
ValidHTMLTest.php:28
Services
LegalDocuments
test
ValidHTMLTest.php
Generated on Wed Sep 10 2025 14:11:34 for ILIAS by
1.8.13 (using
Doxyfile
)