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());