mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 02:54:03 +00:00
Clarify assertions, improve comments
This commit is contained in:
parent
3621cc08c2
commit
7236cd923a
1 changed files with 6 additions and 8 deletions
|
|
@ -73,13 +73,13 @@ test('fortify route tenancy bootstrapper updates fortify config correctly', func
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// The bootstrapper overrides the URLs in the Fortify config correctly (the URLs have the correct tenant parameter + parameter value)
|
// The bootstrapper overrides the URLs in the Fortify config correctly (the URLs have the correct tenant parameter + parameter value)
|
||||||
// RequestDataTenantResolver config should be used
|
// Bootstrapper should generate URLs using RequestDataTenantResolver
|
||||||
FortifyRouteBootstrapper::$passQueryParameter = true;
|
FortifyRouteBootstrapper::$passQueryParameter = true;
|
||||||
|
|
||||||
tenancy()->initialize($tenant);
|
tenancy()->initialize($tenant);
|
||||||
|
|
||||||
expect(config('fortify.home'))->toBe('http://localhost/home?team_query=Acme');
|
expect(config('fortify.home'))->toBe('http://localhost/home?team_query=Acme');
|
||||||
expect(config('fortify.redirects'))->toEqual(['login' => 'http://localhost/welcome?team_query=Acme']);
|
expect(config('fortify.redirects'))->toBe(['login' => 'http://localhost/welcome?team_query=Acme']);
|
||||||
|
|
||||||
// The bootstrapper restores the original Fortify config when ending tenancy
|
// The bootstrapper restores the original Fortify config when ending tenancy
|
||||||
tenancy()->end();
|
tenancy()->end();
|
||||||
|
|
@ -87,13 +87,13 @@ test('fortify route tenancy bootstrapper updates fortify config correctly', func
|
||||||
expect(config('fortify.home'))->toBe($originalFortifyHome);
|
expect(config('fortify.home'))->toBe($originalFortifyHome);
|
||||||
expect(config('fortify.redirects'))->toBe($originalFortifyRedirects);
|
expect(config('fortify.redirects'))->toBe($originalFortifyRedirects);
|
||||||
|
|
||||||
// PathTenantResolver config should be used now
|
// Bootstrapper should generate URLs using PathTenantResolver
|
||||||
FortifyRouteBootstrapper::$passQueryParameter = false;
|
FortifyRouteBootstrapper::$passQueryParameter = false;
|
||||||
|
|
||||||
tenancy()->initialize($tenant);
|
tenancy()->initialize($tenant);
|
||||||
|
|
||||||
expect(config('fortify.home'))->toBe('http://localhost/home?team_path=Foo');
|
expect(config('fortify.home'))->toBe('http://localhost/home?team_path=Foo');
|
||||||
expect(config('fortify.redirects'))->toEqual(['login' => 'http://localhost/welcome?team_path=Foo']);
|
expect(config('fortify.redirects'))->toBe(['login' => 'http://localhost/welcome?team_path=Foo']);
|
||||||
|
|
||||||
tenancy()->end();
|
tenancy()->end();
|
||||||
|
|
||||||
|
|
@ -102,8 +102,6 @@ test('fortify route tenancy bootstrapper updates fortify config correctly', func
|
||||||
|
|
||||||
tenancy()->initialize($tenant);
|
tenancy()->initialize($tenant);
|
||||||
|
|
||||||
expect(config('fortify.home'))->toBe('http://localhost/home')
|
expect(config('fortify.home'))->toBe('http://localhost/home');
|
||||||
->not()->toBe($originalFortifyHome);
|
expect(config('fortify.redirects'))->toBe(['login' => 'http://localhost/welcome']);
|
||||||
expect(config('fortify.redirects'))->toEqual(['login' => 'http://localhost/welcome'])
|
|
||||||
->not()->toBe($originalFortifyRedirects);
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue