mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 12:54:05 +00:00
[4.x] Set app.url config in UrlTenancyBootstrapper (#1068)
* Set `app.url` config in UrlTenancyBootstrapper * Add assertions * Set base app URL in config * Make UrlTenancyBootstrapper a singleton
This commit is contained in:
parent
617e9a7a73
commit
fbdb13f392
3 changed files with 20 additions and 8 deletions
|
|
@ -396,6 +396,7 @@ test('url bootstrapper overrides the root url when tenancy gets initialized and
|
|||
});
|
||||
|
||||
$baseUrl = url(route('home'));
|
||||
config(['app.url' => $baseUrl]);
|
||||
|
||||
$rootUrlOverride = function (Tenant $tenant) use ($baseUrl) {
|
||||
$scheme = str($baseUrl)->before('://');
|
||||
|
|
@ -413,14 +414,17 @@ test('url bootstrapper overrides the root url when tenancy gets initialized and
|
|||
|
||||
expect(url(route('home')))->toBe($baseUrl);
|
||||
expect(URL::to('/'))->toBe($baseUrl);
|
||||
expect(config('app.url'))->toBe($baseUrl);
|
||||
|
||||
tenancy()->initialize($tenant);
|
||||
|
||||
expect(url(route('home')))->toBe($tenantUrl);
|
||||
expect(URL::to('/'))->toBe($tenantUrl);
|
||||
expect(config('app.url'))->toBe($tenantUrl);
|
||||
|
||||
tenancy()->end();
|
||||
|
||||
expect(url(route('home')))->toBe($baseUrl);
|
||||
expect(URL::to('/'))->toBe($baseUrl);
|
||||
expect(config('app.url'))->toBe($baseUrl);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue