1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 09:54:03 +00:00

Pull 3.x changes into master (#922)

* exclude master from CI

* Add space after 'up' in 'docker-compose up-d' (#900)

* Fix ArgumentCountError on the TenantAssetsController (#894)

* Fix ArgumentCount exception on the TenantAssetsController when no `$path` is provided

* CS

* CS

* Handle null case explicitly

* code style

Co-authored-by: Bram Wubs <bram@sibi.nl>
Co-authored-by: Samuel Štancl <samuel@archte.ch>

* Add support for nested tenant config override (#920)

* feat: add support for nested tenant config override

* test: ensure nested tenant values are mapped

* Update TenantConfigTest.php

Co-authored-by: lukinovec <lukinovec@gmail.com>
Co-authored-by: Bram Wubs <megawubs@users.noreply.github.com>
Co-authored-by: Bram Wubs <bram@sibi.nl>
Co-authored-by: George Bishop <email.georgebishop@gmail.com>
Co-authored-by: Abrar Ahmad <abrar.dev99@gmail.com>
This commit is contained in:
Samuel Štancl 2022-08-22 17:59:43 +02:00 committed by GitHub
parent fce95aa862
commit 931c76d697
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 3 deletions

View file

@ -14,6 +14,28 @@ afterEach(function () {
TenantConfig::$storageToConfigMap = [];
});
test('nested tenant values are merged', function () {
expect(config('whitelabel.theme'))->toBeNull();
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);
expect(config('whitelabel.theme'))->toBe('dark');
tenancy()->end();
});
test('config is merged and removed', function () {
expect(config('services.paypal'))->toBe(null);
config([