boot(); } beforeEach(function () { config()->set('domains.domains.b2in.domain_name', 'b2in.eu'); config()->set('domains.domains.b2in.url', 'https://b2in.eu'); config()->set('app.url', 'https://b2in.eu'); }); it('uses the host that was actually called when it is unknown', function () { config()->set('app.env', 'preview'); bootThemeProviderForHost('preview.b2in.eu'); expect(config('app.url'))->toBe('https://preview.b2in.eu') ->and(config('app.asset_url'))->toBe('https://preview.b2in.eu') ->and(config('app.domain_name'))->toBe('preview.b2in.eu'); }); it('keeps the theme of the main site on an unknown host', function () { config()->set('app.env', 'preview'); bootThemeProviderForHost('preview.b2in.eu'); expect(config('app.theme'))->toBe('b2in'); }); it('sticks to the configured url in production, whatever host is claimed', function () { config()->set('app.env', 'production'); bootThemeProviderForHost('boeser-host.example'); expect(config('app.url'))->toBe('https://b2in.eu') ->and(config('app.asset_url'))->toBe('https://b2in.eu'); }); it('still prefers the configured url for a host it knows', function () { config()->set('app.env', 'preview'); bootThemeProviderForHost('b2in.eu'); expect(config('app.url'))->toBe('https://b2in.eu'); });