1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace SimpleSAML\Module\monitor\Test; |
4
|
|
|
|
5
|
|
|
use \SimpleSAML\Module\monitor\DependencyInjection as DependencyInjection; |
6
|
|
|
use \SimpleSAML\Module\monitor\TestConfiguration as TestConfiguration; |
7
|
|
|
use \SimpleSAML\Module\monitor\Monitor as Monitor; |
8
|
|
|
/** |
9
|
|
|
* Tests for Monitor |
10
|
|
|
*/ |
11
|
|
|
class MonitorTest extends \PHPUnit_Framework_TestCase |
12
|
|
|
{ |
13
|
|
|
public function testMonitor() |
14
|
|
|
{ |
15
|
|
|
$serverVars = new DependencyInjection(['SERVER_NAME' => 'localhost']); |
16
|
|
|
$requestVars = new DependencyInjection(['output' => 'travis']); |
17
|
|
|
$globalConfig_input = [ |
18
|
|
|
'enable.saml20-idp' => true, |
19
|
|
|
'enable.shib13-idp' => true, |
20
|
|
|
'enable.adfs-idp' => true, |
21
|
|
|
'enable.wsfed-sp' => true, |
22
|
|
|
'metadata.sources' => [ |
23
|
|
|
[ |
24
|
|
|
'type' => 'xml', |
25
|
|
|
'file' => 'modules/monitor/tests/files/metadata.xml', |
26
|
|
|
], |
27
|
|
|
], |
28
|
|
|
]; |
29
|
|
|
$authSourceConfig_input = [ |
30
|
|
|
'test' => 'travis' |
31
|
|
|
]; |
32
|
|
|
$moduleConfig_input = [ |
33
|
|
|
'test' => 'travis' |
34
|
|
|
]; |
35
|
|
|
$globalConfig = \SimpleSAML_Configuration::loadFromArray($globalConfig_input, 'monitor_glob'); |
36
|
|
|
$authSourceConfig = \SimpleSAML_Configuration::loadFromArray($authSourceConfig_input, 'monitor_auth'); |
37
|
|
|
$moduleConfig = \SimpleSAML_Configuration::loadFromArray($moduleConfig_input, 'monitor_mod'); |
38
|
|
|
$testConf = new TestConfiguration($serverVars, $requestVars, $globalConfig, $authSourceConfig, $moduleConfig); |
39
|
|
|
|
40
|
|
|
$monitor = new Monitor($testConf); |
41
|
|
|
$this->assertEquals($testConf, $monitor->getTestConfiguration()); |
42
|
|
|
|
43
|
|
|
$monitor->invokeTestSuites(); |
44
|
|
|
} |
45
|
|
|
} |
46
|
|
|
|