| Conditions | 4 |
| Paths | 8 |
| Total Lines | 37 |
| Code Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | protected function invokeTestSuite() |
||
| 14 | { |
||
| 15 | $monitor = $this->getMonitor(); |
||
| 16 | $globalConfig = $monitor->getGlobalConfig(); |
||
| 17 | // Check Service Communications Certificate |
||
| 18 | if (\SimpleSAML\Utils\HTTP::isHTTPS()) { |
||
| 19 | $input = array( |
||
| 20 | 'category' => 'Service Communications Certificate', |
||
| 21 | 'hostname' => $_SERVER['SERVER_NAME'], |
||
| 22 | 'port' => $_SERVER['SERVER_PORT'] |
||
| 23 | ); |
||
| 24 | |||
| 25 | $test = new sspmod_monitor_TestCase_Cert_Remote($this, $input); |
||
| 26 | $this->addTest($test); |
||
| 27 | } |
||
| 28 | |||
| 29 | // Check metadata signing certificate when available |
||
| 30 | if ($globalConfig->hasValue('metadata.sign.certificate')) { |
||
| 31 | $metadataCert = $globalConfig->getString('metadata.sign.certificate'); |
||
| 32 | |||
| 33 | $input = array( |
||
| 34 | 'certFile' => \SimpleSAML\Utils\Config::getCertPath($metadataCert), |
||
| 35 | 'category' => 'Metadata Signing Certificate' |
||
| 36 | ); |
||
| 37 | |||
| 38 | $test = new sspmod_monitor_TestCase_Cert_File($this, $input); |
||
| 39 | $this->addTest($test); |
||
| 40 | } |
||
| 41 | |||
| 42 | $tests = $this->getTests(); |
||
| 43 | foreach ($tests as $test) |
||
| 44 | { |
||
| 45 | $this->addMessages($test->getMessages()); |
||
| 46 | } |
||
| 47 | |||
| 48 | $this->calculateState(); |
||
| 49 | } |
||
| 50 | } |
||
| 51 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.