Skip to content

Commit ba93f07

Browse files
committed
modified to save mocked settings in cached file also
1 parent af32e58 commit ba93f07

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

composer.lock

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Mock/Config/MockSettings.php

+2-6
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ public static function setSettings($package, $settingPath, $settingValue ){
3030

3131
$settingsCache = SettingsCache::getInstance();
3232

33-
$settingsCacheReflection = new \ReflectionClass(get_parent_class($settingsCache));
34-
$settingsCacheReflectionProperty = $settingsCacheReflection->getProperty("settings");
35-
$settingsCacheReflectionProperty->setAccessible(true);
36-
37-
$currentSettings = $settingsCacheReflectionProperty->getValue($settingsCache);
33+
$currentSettings = $settingsCache->getData("");
3834

3935
$currentSettingsForProvidedPath = &$currentSettings;
4036
foreach ($settingPaths as $settingPath_){
@@ -46,7 +42,7 @@ public static function setSettings($package, $settingPath, $settingValue ){
4642

4743
$currentSettingsForProvidedPath = $settingValue;
4844

49-
$settingsCacheReflectionProperty->setValue($settingsCache, $currentSettings);
45+
$settingsCache->setData($currentSettings);
5046

5147
}
5248

0 commit comments

Comments
 (0)