mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 12:54:05 +00:00
* Add Vite helper for tenancy * Move Vite bundler to an Optional Feature * Rename to foundation vite * Add ViteBundlerTest * Add missing end of file * Update tests * remove unnecessary end() call Co-authored-by: Samuel Štancl <samuel@archte.ch>
32 lines
805 B
PHP
32 lines
805 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Illuminate\Foundation\Vite as FoundationVite;
|
|
use Illuminate\Support\Facades\App;
|
|
use Stancl\Tenancy\Features\ViteBundler;
|
|
use Stancl\Tenancy\Tests\Etc\Tenant;
|
|
use Stancl\Tenancy\Vite as StanclVite;
|
|
|
|
|
|
test('replaces the vite helper instance with custom class', function () {
|
|
$vite = app(\Illuminate\Foundation\Vite::class);
|
|
|
|
expect($vite)->toBeInstanceOf(FoundationVite::class);
|
|
|
|
expect($vite)->not->toBeInstanceOf(StanclVite::class);
|
|
|
|
config([
|
|
'tenancy.features' => [ViteBundler::class],
|
|
]);
|
|
|
|
$tenant = Tenant::create();
|
|
|
|
tenancy()->initialize($tenant);
|
|
|
|
app()->forgetInstance(\Illuminate\Foundation\Vite::class);
|
|
|
|
$vite = app(\Illuminate\Foundation\Vite::class);
|
|
|
|
expect($vite)->toBeInstanceOf(StanclVite::class);
|
|
});
|