@@ -132,8 +132,9 @@ public function test_its_not_environment_returns_whether_current_environment_non
132132 * ["qa", "i-am-prod-ish"]
133133 * ["ci", null]
134134 * ["imagined", "who-knows-what-i-am"]
135+ * ["standalone", "i-am-standalone"]
135136 */
136- public function test_its_map_environment_returns_value_or_default_for_the_current_env ($ env , $ expect )
137+ public function test_its_map_returns_value_or_default_for_the_current_env ($ env , $ expect )
137138 {
138139 $ subject = $ this ->newSubjectWithEnv ($ env );
139140 $ this ->assertSame (
@@ -142,16 +143,25 @@ public function test_its_map_environment_returns_value_or_default_for_the_curren
142143 ['dev ' , 'i-am-dev ' ],
143144 [['prod ' , 'qa ' ], 'i-am-prod-ish ' ],
144145 ['ci ' , NULL ],
146+ ['standalone ' , 'i-am-standalone ' ],
145147 [DeploymentConfig::ANY , 'who-knows-what-i-am ' ]
146148 )
147149 );
148150 }
149151
150- public function test_its_map_returns_null_in_standalone_env ()
152+ /**
153+ * @testWith ["dev"]
154+ * ["standalone"]
155+ * ["ci"]
156+ */
157+ public function test_its_map_returns_any_for_env_that_is_not_defined ($ env )
151158 {
152- $ subject = $ this ->newSubjectWithEnv (DeploymentConfig::STANDALONE );
153- $ this ->assertNull (
154- $ subject ->map ([DeploymentConfig::ANY , 'even `any` isn \'t taken ' ])
159+ $ subject = $ this ->newSubjectWithEnv ($ env );
160+ $ this ->assertSame (
161+ 'I am anything ' ,
162+ $ subject ->map (
163+ [DeploymentConfig::ANY , 'I am anything ' ]
164+ )
155165 );
156166 }
157167
@@ -162,6 +172,18 @@ public function test_its_map_throws_if_no_value_defined_for_environment()
162172 $ subject ->map ([DeploymentConfig::PRODUCTION , 'prod ' ]);
163173 }
164174
175+ public function test_its_map_returns_null_for_standalone_if_nothing_defined ()
176+ {
177+ $ subject = $ this ->newSubjectWithEnv (DeploymentConfig::STANDALONE );
178+ $ this ->assertSame (
179+ NULL ,
180+ $ subject ->map (
181+ [DeploymentConfig::DEV , 'I am dev ' ],
182+ [DeploymentConfig::PRODUCTION , 'I am production ' ]
183+ )
184+ );
185+ }
186+
165187 public function test_its_map_decrypts_values ()
166188 {
167189 $ this ->decrypter = new PaddedConfigDecryptStub ;
0 commit comments