mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 18:24:04 +00:00
Compare commits
3 commits
cbd2f45737
...
3974ad046e
| Author | SHA1 | Date | |
|---|---|---|---|
| 3974ad046e | |||
|
|
cfae527c93 | ||
|
|
ee0b45d800 |
1 changed files with 3 additions and 1 deletions
|
|
@ -958,12 +958,14 @@ test('pivot record is automatically deleted with the tenant resource', function(
|
||||||
|
|
||||||
$syncMaster->tenants()->attach($tenant);
|
$syncMaster->tenants()->attach($tenant);
|
||||||
|
|
||||||
|
expect(DB::select("SELECT * FROM tenant_users WHERE tenant_id = ?", [$tenant->id]))->toHaveCount(1);
|
||||||
|
|
||||||
$tenant->run(function () {
|
$tenant->run(function () {
|
||||||
TenantUser::firstWhere('global_id', 'cascade_user')->delete();
|
TenantUser::firstWhere('global_id', 'cascade_user')->delete();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Deleting tenant resource deletes its pivot record
|
// Deleting tenant resource deletes its pivot record
|
||||||
expect(DB::select("SELECT * FROM tenant_users WHERE tenant_id = ?", [$tenant->getTenantKey()]))->toHaveCount(0);
|
expect(DB::select("SELECT * FROM tenant_users WHERE tenant_id = ?", [$tenant->id]))->toHaveCount(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('DeleteAllTenantMappings handles incorrect configuration correctly', function() {
|
test('DeleteAllTenantMappings handles incorrect configuration correctly', function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue