1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-04 20:14:04 +00:00

Add TenancyTestCase base class for tenant-aware test initialization and central context support

- Adds a reusable base test case to simplify writing tenant-aware tests
- Automatically initializes tenancy using TEST_TENANT from config or .env.testing
- Provides `runInCentralContext()` to temporarily switch to central DB context
- Improves test reliability and consistency for multi-tenant applications
This commit is contained in:
lokeshrangani 2025-05-12 19:00:54 +05:30
parent d98a170fbd
commit cf5ec0be6d
2 changed files with 73 additions and 0 deletions

View file

@ -196,4 +196,6 @@ return [
'--class' => 'DatabaseSeeder', // root seeder class
// '--force' => true, // This needs to be true to seed tenant databases in production
],
'test_tenant' => env('TEST_TENANT', 1),
];