From 316a3b45fe9f06559281a0ac4507b081b00f6ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Mon, 25 Aug 2025 16:09:13 +0200 Subject: [PATCH] Simplify test further --- tests/Features/ViteBundlerTest.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tests/Features/ViteBundlerTest.php b/tests/Features/ViteBundlerTest.php index bbaa21c2..921528b0 100644 --- a/tests/Features/ViteBundlerTest.php +++ b/tests/Features/ViteBundlerTest.php @@ -3,16 +3,12 @@ declare(strict_types=1); use Illuminate\Foundation\Vite; -use Illuminate\Support\Facades\Event; -use Stancl\Tenancy\Actions\CloneRoutesAsTenant; use Stancl\Tenancy\Bootstrappers\FilesystemTenancyBootstrapper; -use Stancl\Tenancy\Events\TenancyEnded; -use Stancl\Tenancy\Events\TenancyInitialized; use Stancl\Tenancy\Features\ViteBundler; -use Stancl\Tenancy\Listeners\BootstrapTenancy; -use Stancl\Tenancy\Listeners\RevertToCentralContext; use Stancl\Tenancy\Tests\Etc\Tenant; +use function Stancl\Tenancy\Tests\withBootstrapping; + beforeEach(function () { config([ '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 () { config(['tenancy.features' => [ViteBundler::class]]); - app(CloneRoutesAsTenant::class)->handle(); - - Event::listen(TenancyInitialized::class, BootstrapTenancy::class); - Event::listen(TenancyEnded::class, RevertToCentralContext::class); + withBootstrapping(); tenancy()->initialize(Tenant::create());