1 | <?php |
||
18 | class ConfigurationTest extends \PHPUnit_Framework_TestCase |
||
19 | { |
||
20 | public function testDefaultConfiguration() |
||
21 | { |
||
22 | $config = $this->processConfiguration(array(array())); |
||
23 | |||
24 | $expected = $this->getDefaultConfiguration(); |
||
25 | |||
26 | $this->assertEquals($expected, $config); |
||
27 | } |
||
28 | |||
29 | public function testKeysAreNotNormalized() |
||
30 | { |
||
31 | $values = array( |
||
32 | 'page' => array( |
||
33 | 'head' => array('data-example' => 'abc-123'), |
||
34 | 'metas' => array( |
||
35 | 'http-equiv' => array( |
||
36 | 'Content-Type' => 'text/html; charset=utf-8', |
||
37 | ), |
||
38 | ), |
||
39 | ), |
||
40 | ); |
||
41 | |||
42 | $config = $this->processConfiguration(array($values)); |
||
43 | |||
44 | $expected = array_merge_recursive( |
||
45 | $this->getDefaultConfiguration(), |
||
46 | $values |
||
47 | ); |
||
48 | |||
49 | $this->assertEquals($expected, $config); |
||
50 | } |
||
51 | |||
52 | public function testWithYamlConfig() |
||
67 | |||
68 | private function getDefaultConfiguration() |
||
69 | { |
||
85 | |||
86 | private function processConfiguration(array $configs) |
||
93 | } |
||
94 |