mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 22:14:03 +00:00
Throw exception on nonexistent table in DeleteAllTenantMappings
This commit is contained in:
parent
53c7d4988c
commit
4f3c973858
2 changed files with 3 additions and 7 deletions
|
|
@ -978,10 +978,10 @@ test('DeleteAllTenantMappings handles incorrect configuration correctly', functi
|
|||
// Should throw an exception when tenant is deleted
|
||||
expect(fn() => $tenant1->delete())->toThrow(QueryException::class, "Unknown column 'non_existent_column' in 'where clause'");
|
||||
|
||||
// Non-existent table, the listener skips it, no exception to throw
|
||||
// Non-existent table
|
||||
DeleteAllTenantMappings::$pivotTables = ['nonexistent_pivot' => 'non_existent_column'];
|
||||
|
||||
expect(fn() => $tenant2->delete())->not()->toThrow(Exception::class);
|
||||
expect(fn() => $tenant2->delete())->toThrow(QueryException::class, "Table 'main.nonexistent_pivot' doesn't exist");
|
||||
});
|
||||
|
||||
test('trashed resources are synced correctly', function () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue