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

Simplify test further

This commit is contained in:
Samuel Štancl 2025-08-25 16:09:13 +02:00
parent 6974147042
commit 316a3b45fe

View file

@ -3,16 +3,12 @@
declare(strict_types=1); declare(strict_types=1);
use Illuminate\Foundation\Vite; use Illuminate\Foundation\Vite;
use Illuminate\Support\Facades\Event;
use Stancl\Tenancy\Actions\CloneRoutesAsTenant;
use Stancl\Tenancy\Bootstrappers\FilesystemTenancyBootstrapper; use Stancl\Tenancy\Bootstrappers\FilesystemTenancyBootstrapper;
use Stancl\Tenancy\Events\TenancyEnded;
use Stancl\Tenancy\Events\TenancyInitialized;
use Stancl\Tenancy\Features\ViteBundler; use Stancl\Tenancy\Features\ViteBundler;
use Stancl\Tenancy\Listeners\BootstrapTenancy;
use Stancl\Tenancy\Listeners\RevertToCentralContext;
use Stancl\Tenancy\Tests\Etc\Tenant; use Stancl\Tenancy\Tests\Etc\Tenant;
use function Stancl\Tenancy\Tests\withBootstrapping;
beforeEach(function () { beforeEach(function () {
config([ config([
'tenancy.filesystem.asset_helper_override' => true, 'tenancy.filesystem.asset_helper_override' => true,
@ -23,10 +19,7 @@ beforeEach(function () {
test('vite bundler ensures vite assets use global_asset when asset_helper_override is enabled', function () { test('vite bundler ensures vite assets use global_asset when asset_helper_override is enabled', function () {
config(['tenancy.features' => [ViteBundler::class]]); config(['tenancy.features' => [ViteBundler::class]]);
app(CloneRoutesAsTenant::class)->handle(); withBootstrapping();
Event::listen(TenancyInitialized::class, BootstrapTenancy::class);
Event::listen(TenancyEnded::class, RevertToCentralContext::class);
tenancy()->initialize(Tenant::create()); tenancy()->initialize(Tenant::create());