|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace SimpleSAML\Modules\Monitor\Test; |
|
4
|
|
|
|
|
5
|
|
|
use \SimpleSAML\Modules\Monitor\DependencyInjection as DependencyInjection; |
|
6
|
|
|
use \SimpleSAML\Modules\Monitor\TestConfiguration as TestConfiguration; |
|
7
|
|
|
use \SimpleSAML\Modules\Monitor\Monitor as Monitor; |
|
8
|
|
|
|
|
9
|
|
|
// This test relies on \SimpleSAML_Configuration::setPreLoadedConfig(), which is not available until after 1.15.4 |
|
10
|
|
|
if (method_exists('SimpleSAML_Configuration', 'setPreLoadedConfig')) { |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* Tests for Monitor |
|
14
|
|
|
*/ |
|
15
|
|
|
class MonitorTest extends \SimpleSAML\Test\Utils\ClearStateTestCase |
|
16
|
|
|
{ |
|
17
|
|
|
public function testMonitor() |
|
18
|
|
|
{ |
|
19
|
|
|
$_SERVER['REQUEST_URI'] = '/'; |
|
20
|
|
|
$serverVars = new DependencyInjection(['SERVER_NAME' => 'localhost']); |
|
21
|
|
|
$requestVars = new DependencyInjection(['output' => 'travis']); |
|
22
|
|
|
$globalConfig_input = [ |
|
23
|
|
|
'enable.saml20-idp' => true, |
|
24
|
|
|
'enable.shib13-idp' => true, |
|
25
|
|
|
'enable.adfs-idp' => true, |
|
26
|
|
|
'enable.wsfed-sp' => true, |
|
27
|
|
|
'metadata.sources' => [ |
|
28
|
|
|
[ |
|
29
|
|
|
'type' => 'flatfile', |
|
30
|
|
|
'file' => 'modules/monitor/tests/files/saml20-idp-remote.php', |
|
31
|
|
|
], |
|
32
|
|
|
], |
|
33
|
|
|
'database.dsn' => 'mysql:host=localhost;dbname=saml', |
|
34
|
|
|
]; |
|
35
|
|
|
$authSourceConfig_input = [ |
|
36
|
|
|
'test' => 'travis' |
|
37
|
|
|
]; |
|
38
|
|
|
$moduleConfig_input = [ |
|
39
|
|
|
'test' => 'travis' |
|
40
|
|
|
]; |
|
41
|
|
|
$globalConfig = \SimpleSAML_Configuration::loadFromArray($globalConfig_input); |
|
42
|
|
|
$authSourceConfig = \SimpleSAML_Configuration::loadFromArray($authSourceConfig_input); |
|
43
|
|
|
$moduleConfig = \SimpleSAML_Configuration::loadFromArray($moduleConfig_input); |
|
44
|
|
|
|
|
45
|
|
|
\SimpleSAML_Configuration::setPreLoadedConfig($globalConfig, 'config.php'); |
|
|
|
|
|
|
46
|
|
|
\SimpleSAML_Configuration::setPreLoadedConfig($moduleConfig, 'module_monitor.php'); |
|
47
|
|
|
\SimpleSAML_Configuration::setPreLoadedConfig($authSourceConfig, 'authsources.php'); |
|
48
|
|
|
|
|
49
|
|
|
$testConf = new TestConfiguration($serverVars, $requestVars, $globalConfig, $authSourceConfig, $moduleConfig); |
|
50
|
|
|
$monitor = new Monitor($testConf); |
|
51
|
|
|
$this->assertEquals($testConf, $monitor->getTestConfiguration()); |
|
52
|
|
|
|
|
53
|
|
|
$monitor->invokeTestSuites(); |
|
54
|
|
|
} |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
} |
|
58
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.