|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace SimpleSAML\Module\monitor\Test; |
|
4
|
|
|
|
|
5
|
|
|
use \SimpleSAML\Module\monitor\State as State; |
|
6
|
|
|
use \SimpleSAML\Module\monitor\TestData as TestData; |
|
7
|
|
|
use \SimpleSAML\Module\monitor\TestResult as TestResult; |
|
8
|
|
|
use \SimpleSAML\Module\monitor\DependencyInjection as DependencyInjection; |
|
9
|
|
|
use \SimpleSAML\Module\monitor\TestConfiguration as TestConfiguration; |
|
10
|
|
|
use \SimpleSAML\Module\monitor\TestSuiteFactory as TestSuiteFactory; |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* Tests for TestSuiteFactory |
|
14
|
|
|
*/ |
|
15
|
|
|
class TestSuiteFactoryTest extends \PHPUnit_Framework_TestCase |
|
16
|
|
|
{ |
|
17
|
|
|
public function testTestSuiteFactory() |
|
18
|
|
|
{ |
|
19
|
|
|
$config = new TestConfiguration( |
|
20
|
|
|
new DependencyInjection([]), |
|
21
|
|
|
new DependencyInjection([]), |
|
22
|
|
|
\SimpleSAML_Configuration::loadFromArray(['metadata.sources' => []]), |
|
23
|
|
|
\SimpleSAML_Configuration::loadFromArray([]), |
|
24
|
|
|
\SimpleSAML_Configuration::loadFromArray([]) |
|
25
|
|
|
); |
|
26
|
|
|
$testData = new TestData(['travis' => 'travis', 'test' => 'travis']); |
|
27
|
|
|
$testSuite = new TestSuiteImplementation($config, $testData); |
|
|
|
|
|
|
28
|
|
|
$this->assertEquals(State::NOSTATE, $testSuite->calculateState()); |
|
29
|
|
|
$this->assertEquals($testData, $testSuite->getTestData()); |
|
30
|
|
|
|
|
31
|
|
|
$results = $testSuite->prepareTests(); |
|
32
|
|
|
|
|
33
|
|
|
$this->assertEquals($config, $testSuite->getConfiguration()); |
|
34
|
|
|
$this->assertEquals($results, $testSuite->getTestResults()); |
|
35
|
|
|
$this->assertEquals([ |
|
36
|
|
|
['state' => State::ERROR, 'category' => 'a', 'subject' => 'b', 'message' => ''], |
|
37
|
|
|
['state' => State::WARNING, 'category' => 'c', 'subject' => 'd', 'message' => ''], |
|
38
|
|
|
['state' => State::OK, 'category' => 'e', 'subject' => 'f', 'message' => ''], |
|
39
|
|
|
], $testSuite->getArrayizeTestResults()); |
|
40
|
|
|
|
|
41
|
|
|
$this->assertEquals('travis', $testSuite->getCategory()); |
|
42
|
|
|
$this->assertEquals('travis', $testSuite->getSubject()); |
|
43
|
|
|
|
|
44
|
|
|
$this->assertEquals(State::ERROR, $testSuite->calculateState()); |
|
45
|
|
|
} |
|
46
|
|
|
} |
|
47
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths