1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 18:34:04 +00:00
tenancy/tests/TenantConfigTest.php
2019-09-30 16:37:02 +02:00

35 lines
No EOL
953 B
PHP

<?php
namespace Stancl\Tenancy\Tests;
use Stancl\Tenancy\Tenant;
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()->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'));
}
}