1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 14:14:03 +00:00
This commit is contained in:
Samuel Štancl 2019-11-04 12:24:20 +01:00
parent 3174256bd2
commit 6ed68dfd7f
4 changed files with 69 additions and 6 deletions

View file

@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Tests\Feature;
class TenantConfigTest extends TestCase
{
public $autoInitTenancy = false;
public $autoCreateTenant = false;
/** @test */
public function config_is_merged_and_removed()
{
$this->assertSame(null, config('services.paypal'));
config([
'tenancy.storage_to_config_map' => [
'paypal_api_public' => 'services.paypal.public',
'paypal_api_private' => 'services.paypal.private',
],
'tenancy.features' => ['Stancl\Tenancy\Features\TenantConfig'],
]);
tenancy()->create('foo.localhost', [
'paypal_api_public' => 'foo',
'paypal_api_private' => 'bar',
]);
tenancy()->init('foo.localhost');
$this->assertSame(['public' => 'foo', 'private' => 'bar'], config('services.paypal'));
tenancy()->end();
$this->assertSame([
'public' => null,
'private' => null,
], config('services.paypal'));
}
}