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:
parent
a6df4e526e
commit
936b32475e
1 changed files with 12 additions and 0 deletions
|
|
@ -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();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue