ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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  {
31  $validator = new ilTermsOfServiceDocumentsContainsHtmlValidator($text);
32  $this->assertEquals($result, $validator->isValid());
33  }
34 }
$result
Class ilTermsOfServiceCriterionBaseTest.