From 936b32475ead320257891fb2730be23bab635978 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Thu, 3 Apr 2025 16:10:50 +0200 Subject: [PATCH] Add regressiont test --- tests/ScopeSessionsTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/ScopeSessionsTest.php b/tests/ScopeSessionsTest.php index e62fa370..4fccac58 100644 --- a/tests/ScopeSessionsTest.php +++ b/tests/ScopeSessionsTest.php @@ -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(); +});