mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 01:14:03 +00:00
Use 'clone' instead of a universal route in tenant parameter removal test
This commit is contained in:
parent
228d6ca788
commit
37306e73d3
1 changed files with 9 additions and 9 deletions
|
|
@ -344,9 +344,9 @@ test('the tenant parameter is only removed from tenant routes when using path id
|
||||||
->middleware('tenant')
|
->middleware('tenant')
|
||||||
->name('tenant-route');
|
->name('tenant-route');
|
||||||
|
|
||||||
RouteFacade::get($pathIdentification ? '/universal-route' : '/universal-route/{tenant?}', [ControllerWithMiddleware::class, 'routeHasTenantParameter'])
|
RouteFacade::get($pathIdentification ? '/cloned-route' : '/cloned-route/{tenant?}', [ControllerWithMiddleware::class, 'routeHasTenantParameter'])
|
||||||
->middleware('universal')
|
->middleware('clone')
|
||||||
->name('universal-route');
|
->name('cloned-route');
|
||||||
|
|
||||||
/** @var CloneRoutesAsTenant */
|
/** @var CloneRoutesAsTenant */
|
||||||
$cloneRoutesAction = app(CloneRoutesAsTenant::class);
|
$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();
|
$response = pest()->get($tenantKey . '/tenant-route')->assertOk();
|
||||||
expect((bool) $response->getContent())->toBeFalse();
|
expect((bool) $response->getContent())->toBeFalse();
|
||||||
|
|
||||||
// The tenant parameter gets removed from the cloned universal route
|
// The tenant parameter gets removed from the cloned route
|
||||||
$response = pest()->get($tenantKey . '/universal-route')->assertOk();
|
$response = pest()->get($tenantKey . '/cloned-route')->assertOk();
|
||||||
expect((bool) $response->getContent())->toBeFalse();
|
expect((bool) $response->getContent())->toBeFalse();
|
||||||
} else {
|
} else {
|
||||||
// Tenant parameter is not removed from tenant routes using other kernel identification MW
|
// 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();
|
$response = pest()->get("http://{$domain}/{$tenantKey}/tenant-route")->assertOk();
|
||||||
expect((bool) $response->getContent())->toBeTrue();
|
expect((bool) $response->getContent())->toBeTrue();
|
||||||
|
|
||||||
// The tenant parameter does not get removed from the universal route when accessing it through the central domain
|
// The tenant parameter does not get removed from the cloned route when accessing it through the central domain
|
||||||
$response = pest()->get("http://localhost/universal-route/$tenantKey")->assertOk();
|
$response = pest()->get("http://localhost/cloned-route/$tenantKey")->assertOk();
|
||||||
expect((bool) $response->getContent())->toBeTrue();
|
expect((bool) $response->getContent())->toBeTrue();
|
||||||
|
|
||||||
// The tenant parameter gets removed from the universal route when accessing it through the tenant domain
|
// The tenant parameter gets removed from the cloned route when accessing it through the tenant domain
|
||||||
$response = pest()->get("http://{$domain}/universal-route")->assertOk();
|
$response = pest()->get("http://{$domain}/cloned-route")->assertOk();
|
||||||
expect((bool) $response->getContent())->toBeFalse();
|
expect((bool) $response->getContent())->toBeFalse();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue