1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 05:14:03 +00:00

Clarify assertions, improve comments

This commit is contained in:
lukinovec 2025-06-11 11:31:48 +02:00
parent 3621cc08c2
commit 7236cd923a

View file

@ -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)
// RequestDataTenantResolver config should be used
// Bootstrapper should generate URLs using RequestDataTenantResolver
FortifyRouteBootstrapper::$passQueryParameter = true;
tenancy()->initialize($tenant);
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
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.redirects'))->toBe($originalFortifyRedirects);
// PathTenantResolver config should be used now
// Bootstrapper should generate URLs using PathTenantResolver
FortifyRouteBootstrapper::$passQueryParameter = false;
tenancy()->initialize($tenant);
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();
@ -102,8 +102,6 @@ test('fortify route tenancy bootstrapper updates fortify config correctly', func
tenancy()->initialize($tenant);
expect(config('fortify.home'))->toBe('http://localhost/home')
->not()->toBe($originalFortifyHome);
expect(config('fortify.redirects'))->toEqual(['login' => 'http://localhost/welcome'])
->not()->toBe($originalFortifyRedirects);
expect(config('fortify.home'))->toBe('http://localhost/home');
expect(config('fortify.redirects'))->toBe(['login' => 'http://localhost/welcome']);
});