mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 19:34:04 +00:00
By default, only override the config if the override tenant property is set (otherwise, just skip the override and keep the default config value)
This commit is contained in:
parent
582243c53f
commit
bd44036a9f
2 changed files with 17 additions and 1 deletions
|
|
@ -150,6 +150,20 @@ test('channel overrides work correctly with both arrays and closures', function
|
|||
expect(config('logging.channels.slack.username'))->toBe('Default');
|
||||
});
|
||||
|
||||
test('channel config keys remains unchanged if the specified tenant override property is not set', function() {
|
||||
config(['logging.default' => 'slack']);
|
||||
config(['logging.channels.slack.username' => 'Default username']);
|
||||
|
||||
LogTenancyBootstrapper::$channelOverrides = [
|
||||
'slack' => ['username' => 'nonExistentProperty'], // $tenant->nonExistentProperty
|
||||
];
|
||||
|
||||
tenancy()->initialize(Tenant::create());
|
||||
|
||||
// The username should remain unchanged since the tenant property is not set
|
||||
expect(config('logging.channels.slack.username'))->toBe('Default username');
|
||||
});
|
||||
|
||||
test('channel overrides take precedence over the default storage path channel updating logic', function () {
|
||||
config(['logging.default' => 'single']);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue