mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 22:24:03 +00:00
Use withtenantDatabases where needed
This commit is contained in:
parent
cda2a57fb0
commit
23b028da36
5 changed files with 31 additions and 11 deletions
|
|
@ -50,6 +50,8 @@ test('context is switched when tenancy is reinitialized', function () {
|
|||
});
|
||||
|
||||
test('central helper runs callbacks in the central state', function () {
|
||||
withTenantDatabases();
|
||||
|
||||
tenancy()->initialize($tenant = Tenant::create());
|
||||
|
||||
tenancy()->central(function () {
|
||||
|
|
@ -60,6 +62,8 @@ test('central helper runs callbacks in the central state', function () {
|
|||
});
|
||||
|
||||
test('central helper returns the value from the callback', function () {
|
||||
withTenantDatabases();
|
||||
|
||||
tenancy()->initialize(Tenant::create());
|
||||
|
||||
pest()->assertSame('foo', tenancy()->central(function () {
|
||||
|
|
@ -68,6 +72,8 @@ test('central helper returns the value from the callback', function () {
|
|||
});
|
||||
|
||||
test('central helper reverts back to tenant context', function () {
|
||||
withTenantDatabases();
|
||||
|
||||
tenancy()->initialize($tenant = Tenant::create());
|
||||
|
||||
tenancy()->central(function () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue