1 | <?php |
||
9 | class ConfigurationTest extends \PHPUnit_Framework_TestCase |
||
10 | { |
||
11 | /** |
||
12 | * Tests example configuration. Will throw exception if does not validate. |
||
13 | * |
||
14 | * @param string $path |
||
15 | * |
||
16 | * @dataProvider getValidConfigurationsPaths |
||
17 | */ |
||
18 | public function testValidConfigurations($path) |
||
19 | { |
||
20 | $config = Yaml::parse(file_get_contents($path)); |
||
21 | $processor = new Processor(); |
||
22 | $configuration = new Configuration(); |
||
23 | |||
24 | $processor->processConfiguration( |
||
25 | $configuration, |
||
26 | $config |
||
27 | ); |
||
28 | |||
29 | $this->assertTrue(true); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @param string $path |
||
34 | * |
||
35 | * @dataProvider getInvalidConfigurationsPaths |
||
36 | * |
||
37 | * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException |
||
38 | */ |
||
39 | public function testInvalidConfigurations($path) |
||
40 | { |
||
41 | $config = Yaml::parse(file_get_contents($path)); |
||
42 | $processor = new Processor(); |
||
43 | $configuration = new Configuration(); |
||
44 | |||
45 | $processor->processConfiguration( |
||
46 | $configuration, |
||
47 | $config |
||
48 | ); |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @return array |
||
53 | */ |
||
54 | public function getValidConfigurationsPaths() |
||
58 | |||
59 | /** |
||
60 | * @return array |
||
61 | */ |
||
62 | public function getInvalidConfigurationsPaths() |
||
66 | |||
67 | /** |
||
68 | * @param string $type |
||
69 | * |
||
70 | * @return array |
||
71 | */ |
||
72 | public function getConfigurationsPaths($type) |
||
85 | |||
86 | /** |
||
87 | * @return string |
||
88 | * |
||
89 | */ |
||
90 | private function getConfigsDir() |
||
102 | } |
||
103 |