From 37306e73d332ac5c94b3f5ee144721cf8abdff18 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Fri, 16 May 2025 17:29:46 +0200 Subject: [PATCH] Use 'clone' instead of a universal route in tenant parameter removal test --- tests/EarlyIdentificationTest.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/EarlyIdentificationTest.php b/tests/EarlyIdentificationTest.php index 48ac4d12..a95bac0b 100644 --- a/tests/EarlyIdentificationTest.php +++ b/tests/EarlyIdentificationTest.php @@ -344,9 +344,9 @@ test('the tenant parameter is only removed from tenant routes when using path id ->middleware('tenant') ->name('tenant-route'); - RouteFacade::get($pathIdentification ? '/universal-route' : '/universal-route/{tenant?}', [ControllerWithMiddleware::class, 'routeHasTenantParameter']) - ->middleware('universal') - ->name('universal-route'); + RouteFacade::get($pathIdentification ? '/cloned-route' : '/cloned-route/{tenant?}', [ControllerWithMiddleware::class, 'routeHasTenantParameter']) + ->middleware('clone') + ->name('cloned-route'); /** @var CloneRoutesAsTenant */ $cloneRoutesAction = app(CloneRoutesAsTenant::class); @@ -364,8 +364,8 @@ test('the tenant parameter is only removed from tenant routes when using path id $response = pest()->get($tenantKey . '/tenant-route')->assertOk(); expect((bool) $response->getContent())->toBeFalse(); - // The tenant parameter gets removed from the cloned universal route - $response = pest()->get($tenantKey . '/universal-route')->assertOk(); + // The tenant parameter gets removed from the cloned route + $response = pest()->get($tenantKey . '/cloned-route')->assertOk(); expect((bool) $response->getContent())->toBeFalse(); } else { // Tenant parameter is not removed from tenant routes using other kernel identification MW @@ -374,12 +374,12 @@ test('the tenant parameter is only removed from tenant routes when using path id $response = pest()->get("http://{$domain}/{$tenantKey}/tenant-route")->assertOk(); expect((bool) $response->getContent())->toBeTrue(); - // The tenant parameter does not get removed from the universal route when accessing it through the central domain - $response = pest()->get("http://localhost/universal-route/$tenantKey")->assertOk(); + // The tenant parameter does not get removed from the cloned route when accessing it through the central domain + $response = pest()->get("http://localhost/cloned-route/$tenantKey")->assertOk(); expect((bool) $response->getContent())->toBeTrue(); - // The tenant parameter gets removed from the universal route when accessing it through the tenant domain - $response = pest()->get("http://{$domain}/universal-route")->assertOk(); + // The tenant parameter gets removed from the cloned route when accessing it through the tenant domain + $response = pest()->get("http://{$domain}/cloned-route")->assertOk(); expect((bool) $response->getContent())->toBeFalse(); } } else {