mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 11:44:04 +00:00
test: ensure nested tenant values are mapped
This commit is contained in:
parent
c3409e39e3
commit
32eb3ad339
1 changed files with 24 additions and 0 deletions
|
|
@ -22,6 +22,30 @@ class TenantConfigTest extends TestCase
|
|||
parent::tearDown();
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function nested_tenant_values_are_merged()
|
||||
{
|
||||
$this->assertSame(null, config('whitelabel.theme'));
|
||||
config([
|
||||
'tenancy.features' => [TenantConfig::class],
|
||||
'tenancy.bootstrappers' => [],
|
||||
]);
|
||||
Event::listen(TenancyInitialized::class, BootstrapTenancy::class);
|
||||
Event::listen(TenancyEnded::class, RevertToCentralContext::class);
|
||||
|
||||
TenantConfig::$storageToConfigMap = [
|
||||
'whitelabel.config.theme' => 'whitelabel.theme',
|
||||
];
|
||||
|
||||
$tenant = Tenant::create([
|
||||
'whitelabel' => ['config' => ['theme' => 'dark']],
|
||||
]);
|
||||
|
||||
tenancy()->initialize($tenant);
|
||||
$this->assertSame('dark', config('whitelabel.theme'));
|
||||
tenancy()->end();
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function config_is_merged_and_removed()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue