@@ -28,6 +28,26 @@ class ConfigEnvTest extends BaseConfigTest
28
28
* @return \Asm\Config\ConfigInterface
29
29
*/
30
30
public function testFactoryProd ()
31
+ {
32
+ // merged environments config
33
+ $ config = Config::factory (
34
+ [
35
+ 'file ' => $ this ->getTestYaml (),
36
+ ],
37
+ 'ConfigEnv '
38
+ );
39
+
40
+ $ this ->assertInstanceOf ('Asm\Config\ConfigEnv ' , $ config );
41
+
42
+ return $ config ;
43
+ }
44
+
45
+ /**
46
+ * @covers \Asm\Config\ConfigEnv::mergeEnvironments
47
+ * @covers \Asm\Config\ConfigEnv::__construct
48
+ * @return \Asm\Config\ConfigInterface
49
+ */
50
+ public function testFactoryProdWithoutFilecheck ()
31
51
{
32
52
// merged environments config
33
53
$ config = Config::factory (
@@ -52,8 +72,7 @@ public function testFactoryEnv()
52
72
{
53
73
$ config = Config::factory (
54
74
[
55
- 'file ' => TestData::getYamlConfigFile (),
56
- 'filecheck ' => false ,
75
+ 'file ' => $ this ->getTestYaml (),
57
76
'defaultEnv ' => 'prod ' ,
58
77
'env ' => 'dev ' ,
59
78
],
@@ -73,4 +92,32 @@ public function testConfigMerge(ConfigEnv $config)
73
92
{
74
93
$ this ->assertEquals (25 , $ config ->get ('testkey_2 ' , 0 ));
75
94
}
95
+
96
+
97
+ /**
98
+ * @depends testFactoryEnv
99
+ * @param ConfigEnv $config
100
+ */
101
+ public function testConfigInclude (ConfigEnv $ config )
102
+ {
103
+ $ this ->assertEquals (
104
+ [
105
+ 'default ' => 'yaddayadda ' ,
106
+ 'my_test ' => 'is testing hard '
107
+ ],
108
+ $ config ->get ('testkey_5 ' )
109
+ );
110
+ }
111
+
112
+ /**
113
+ * @depends testFactoryEnv
114
+ * @param ConfigEnv $config
115
+ */
116
+ public function testConfigDefaultNode (ConfigEnv $ config )
117
+ {
118
+ $ this ->assertEquals (
119
+ 'default test ' ,
120
+ $ config ->get ('testkey_4 ' )
121
+ );
122
+ }
76
123
}
0 commit comments