mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 13:54:03 +00:00
Change URI prefix order during route cloning (#49)
* Change URI prefix order [ci skip] * Move route cloning to `$this->app->booted()` [ci skip] * Delete note about LW v2 * Improve comments/docblock [skip ci] * Fix comment in test, improve assertion [skip ci]
This commit is contained in:
parent
7317d2638a
commit
b789f5c561
3 changed files with 53 additions and 47 deletions
|
|
@ -258,11 +258,13 @@ test('the clone action prefixes already prefixed routes correctly', function ()
|
|||
$clonedRouteUrl = route($clonedRouteName, ['tenant' => $tenant = Tenant::create()]);
|
||||
|
||||
// The cloned route is prefixed correctly
|
||||
expect($clonedRoute->getPrefix())->toBe('{tenant}/' . $prefix);
|
||||
expect($clonedRoute->getPrefix())->toBe("{$prefix}/{tenant}");
|
||||
|
||||
expect($clonedRouteUrl)
|
||||
->toContain('/' . $tenant->getTenantKey() . '/' . $prefix . '/home')
|
||||
->not()->toContain($prefix . '/' . $tenant->getTenantKey() . '/' . $prefix . '/home');
|
||||
// Original prefix does not occur in the cloned route's URL
|
||||
->not()->toContain("/{$prefix}/{$tenant->getTenantKey()}/{$prefix}")
|
||||
// Route is prefixed correctly
|
||||
->toBe("http://localhost/{$prefix}/{$tenant->getTenantKey()}/home");
|
||||
|
||||
// The cloned route is accessible
|
||||
pest()->get($clonedRouteUrl)->assertSee('Tenancy initialized.');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue