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

Add regressiont test

This commit is contained in:
lukinovec 2025-04-03 16:10:50 +02:00
parent a6df4e526e
commit 936b32475e

View file

@ -55,3 +55,15 @@ test('an exception is thrown when the middleware is executed before tenancy is i
pest()->expectException(TenancyNotInitializedException::class);
$this->withoutExceptionHandling()->get('http://acme.localhost/bar');
});
test('scope sessions mw can be used on universal routes', function() {
Route::get('/universal', function () {
return true;
})->middleware(['universal', InitializeTenancyBySubdomain::class, ScopeSessions::class]);
Tenant::create([
'id' => 'acme',
])->createDomain('acme');
pest()->withoutExceptionHandling()->get('http://localhost/universal')->assertSuccessful();
});