ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilWhiteListUrlValidatorTest Class Reference

Class ilWhiteListUrlValidatorTest. More...

+ Inheritance diagram for ilWhiteListUrlValidatorTest:
+ Collaboration diagram for ilWhiteListUrlValidatorTest:

Public Member Functions

 domainProvider ()
 
 testValidator (string $domain, array $whitelist, bool $result)
 domainProvider More...
 

Detailed Description

Member Function Documentation

◆ domainProvider()

ilWhiteListUrlValidatorTest::domainProvider ( )
Returns
array

Definition at line 14 of file ilWhiteListUrlValidatorTest.php.

14  : array
15  {
16  return [
17  ['', [], false],
18  ['ilias.de', [], false],
19  ['https://ilias.de', [], false],
20  ['ilias.de', ['ilias.de'], false],
21  ['https://ilias.de', ['ilias.de'], true],
22  ['https://www.ilias.de', ['ilias.de'], true],
23  ['https://server01.www.ilias.de', ['ilias.de'], true],
24  ['https://server01.www.ilias.de', ['.ilias.de'], true],
25  ['https://server01.www.ilias.de', ['www.ilias.de'], true],
26  ['https://server01.www.ilias.de', ['.www.ilias.de'], true],
27  ['https://server01.www.ilias.de', ['server01.www.ilias.de'], true],
28  ['https://server01.www.ilias.de', ['.server01.www.ilias.de'], false],
29  ];
30  }

◆ testValidator()

ilWhiteListUrlValidatorTest::testValidator ( string  $domain,
array  $whitelist,
bool  $result 
)

domainProvider

Parameters
string$domain
array$whitelist
bool$result

Definition at line 38 of file ilWhiteListUrlValidatorTest.php.

39  {
40  require_once 'Services/AuthApache/classes/class.ilWhiteListUrlValidator.php';
41  $this->assertEquals((new ilWhiteListUrlValidator($domain, $whitelist))->isValid(), $result);
42  }
$result
if(!array_key_exists('domain', $_REQUEST)) $domain
Definition: resume.php:8
Class ilWhiteListUrlValidator.

The documentation for this class was generated from the following file: