ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilTermsOfServiceDocumentsContainsHtmlValidatorTest.php
Go to the documentation of this file.
1<?php declare(strict_types=1);
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
9{
13 public function textProvider() : array
14 {
15 return [
16 'Plain Text' => ['phpunit', false,],
17 'HTML Fragment' => ['php<b>unit</b>', true,],
18 'HTML Fragment with Email Address Wrapped in <>' => ['php<b>unit</b> <info@ilias.de>', false,],
19 'HTML' => ['<html><body>php<b>unit</b></body></html>', true,],
20 'HTML with Email Address Wrapped in <>' => ['<html><body>php<b>unit</b>Php Unit <info@ilias.de></body></html>', false,],
21 ];
22 }
23
29 public function testHtmlCanBeDetected(string $text, bool $result) : void
30 {
32 $this->assertEquals($result, $validator->isValid());
33 }
34}
$result
An exception for terminatinating execution or to throw for unit testing.
Class ilTermsOfServiceCriterionBaseTest.
testHtmlCanBeDetected(string $text, bool $result)
@dataProvider textProvider