File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
tests/unit/Mage/Core/Helper Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,44 @@ public function envOverridesCorrectConfigKeysDataProvider(): Generator
198
198
]];
199
199
}
200
200
201
+ /**
202
+ * @runInSeparateProcess
203
+ * @dataProvider envHasPathDataProvider
204
+ * @group Mage_Core
205
+ *
206
+ * @param array<string, string> $config
207
+ */
208
+ public function testHasPath (array $ config ): void
209
+ {
210
+ // phpcs:ignore Ecg.Classes.ObjectInstantiation.DirectInstantiation
211
+ $ loader = new Mage_Core_Helper_EnvironmentConfigLoader ();
212
+ $ loader ->setEnvStore ([
213
+ 'OPENMAGE_CONFIG_OVERRIDE_ALLOWED ' => 1 ,
214
+ $ config ['env_path ' ] => 1 ,
215
+ ]);
216
+ $ actual = $ loader ->hasPath ($ config ['xml_path ' ]);
217
+ $ expected = $ config ['expected ' ];
218
+ $ this ->assertSame ($ expected , $ actual );
219
+ }
220
+
221
+ public function envHasPathDataProvider (): Generator
222
+ {
223
+ yield 'hasPath ' => [
224
+ [
225
+ 'env_path ' => 'OPENMAGE_CONFIG__DEFAULT__GENERAL__STORE_INFORMATION__NAME ' ,
226
+ 'xml_path ' => 'default/general/store_information/name ' ,
227
+ 'expected ' => true ,
228
+ ]
229
+ ];
230
+ yield 'hasNotPath ' => [
231
+ [
232
+ 'env_path ' => 'OPENMAGE_CONFIG__DEFAULT__GENERAL__STORE_INFORMATION__NAME ' ,
233
+ 'xml_path ' => 'foo/foo/foo ' ,
234
+ 'expected ' => false ,
235
+ ]
236
+ ];
237
+ }
238
+
201
239
/**
202
240
* @runInSeparateProcess
203
241
* @dataProvider envDoesNotOverrideOnWrongConfigKeysDataProvider
You can’t perform that action at this time.
0 commit comments