mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 18:54:03 +00:00
Fix typos, add tests
This commit is contained in:
parent
82237bd7f3
commit
0111ed6f53
3 changed files with 36 additions and 5 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Stancl\Tenancy\Tests;
|
||||
|
||||
use Tenancy;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Stancl\Tenancy\Exceptions\CannotChangeUuidOrDomainException;
|
||||
|
|
@ -241,4 +242,34 @@ class TenantManagerTest extends TestCase
|
|||
$this->expectException(CannotChangeUuidOrDomainException::class);
|
||||
tenant()->put(['uuid' => 'foo']);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function bootstrapping_event_works()
|
||||
{
|
||||
$uuid = tenant()->create('foo.localhost')['uuid'];
|
||||
|
||||
Tenancy::bootstrapping(function ($tenantManager) use ($uuid) {
|
||||
if ($tenantManager->tenant['uuid'] === $uuid) {
|
||||
config(['tenancy.foo' => 'bar']);
|
||||
}
|
||||
});
|
||||
|
||||
tenancy()->init('foo.localhost');
|
||||
$this->assertSame('bar', config('tenancy.foo'));
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function bootstrapped_event_works()
|
||||
{
|
||||
$uuid = tenant()->create('foo.localhost')['uuid'];
|
||||
|
||||
Tenancy::bootstrapped(function ($tenantManager) use ($uuid) {
|
||||
if ($tenantManager->tenant['uuid'] === $uuid) {
|
||||
config(['tenancy.foo' => 'bar']);
|
||||
}
|
||||
});
|
||||
|
||||
tenancy()->init('foo.localhost');
|
||||
$this->assertSame('bar', config('tenancy.foo'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue