mirror of
https://github.com/flarum/framework.git
synced 2025-04-24 21:54:04 +08:00
fix: settings extender working only with first instances (#3439)
* test: settings extender works not only with first extender instance * fix: settings extender working only with first instances
This commit is contained in:
parent
584884a3c9
commit
eb4bac3b8f
@ -95,6 +95,8 @@ class Settings implements ExtenderInterface
|
||||
|
||||
$defaults->put($key, $value);
|
||||
}
|
||||
|
||||
return $defaults;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -173,14 +173,16 @@ class SettingsTest extends TestCase
|
||||
(new Extend\Settings())
|
||||
->serializeToForum('customPrefix.unavailableCustomSetting3', 'custom-prefix.unavailable_custom_setting3')
|
||||
->default('custom-prefix.unavailable_custom_setting3', 'extenderDefault')
|
||||
->default('custom-prefix.unavailable_custom_setting100', 'extenderDefault100'),
|
||||
(new Extend\Settings())
|
||||
->default('custom-prefix.unavailable_custom_setting200', 'extenderDefault200')
|
||||
);
|
||||
|
||||
$value = $this->app()
|
||||
->getContainer()
|
||||
->make('flarum.settings')
|
||||
->get('custom-prefix.unavailable_custom_setting3', 'defaultParameterValue');
|
||||
$settings = $this->app()->getContainer()->make('flarum.settings');
|
||||
|
||||
$this->assertEquals('extenderDefault', $value);
|
||||
$this->assertEquals('extenderDefault', $settings->get('custom-prefix.unavailable_custom_setting3'));
|
||||
$this->assertEquals('extenderDefault100', $settings->get('custom-prefix.unavailable_custom_setting100'));
|
||||
$this->assertEquals('extenderDefault200', $settings->get('custom-prefix.unavailable_custom_setting200'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user