mirror of
https://github.com/archtechx/tenancy.git
synced 2026-08-06 19:14:05 +00:00
universal routes capture existing onfail callback (fix #1470)
This commit is contained in:
parent
ab64f4599d
commit
b0d8318d0e
2 changed files with 26 additions and 1 deletions
|
|
@ -88,6 +88,24 @@ class UniversalRouteTest extends TestCase
|
|||
->assertSuccessful()
|
||||
->assertSee('Tenancy is initialized.');
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function universal_route_runs_custom_failed_initialization_override()
|
||||
{
|
||||
InitializeTenancyByDomain::$onFail = function () {
|
||||
return 'custom failed logic.';
|
||||
};
|
||||
|
||||
Route::middlewareGroup('universal', []);
|
||||
config(['tenancy.features' => [UniversalRoutes::class]]);
|
||||
|
||||
Route::get('/foo', fn () => 'Tenant route')
|
||||
->middleware([InitializeTenancyByDomain::class]);
|
||||
|
||||
$this->get('http://acme.localhost/foo')
|
||||
->assertSuccessful()
|
||||
->assertSee('custom failed logic.');
|
||||
}
|
||||
}
|
||||
|
||||
class UniversalRouteController
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue