Passed
Pull Request — master (#12)
by Tim
01:53
created

MonitorTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
B testMonitor() 0 31 1
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 \SimpleSAML\Test\Utils\ClearStateTestCase
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);
36
        $authSourceConfig = \SimpleSAML_Configuration::loadFromArray($authSourceConfig_input);
37
        $moduleConfig = \SimpleSAML_Configuration::loadFromArray($moduleConfig_input);
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