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

MonitorTest::testMonitor()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 31
Code Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 21
nc 1
nop 0
dl 0
loc 31
rs 8.8571
c 0
b 0
f 0
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
0 ignored issues
show
Bug introduced by
The type SimpleSAML\Test\Utils\ClearStateTestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
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