diff --git a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php index b19a57124489..49b688cf200f 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php +++ b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php @@ -5,6 +5,7 @@ use Closure; use Illuminate\Foundation\Mix; use Illuminate\Foundation\Vite; +use Illuminate\Support\Facades\Facade; use Illuminate\Support\HtmlString; use Mockery; @@ -110,6 +111,8 @@ protected function withoutVite() $this->originalVite = app(Vite::class); } + Facade::clearResolvedInstance(Vite::class); + $this->swap(Vite::class, new class { public function __invoke() diff --git a/tests/Integration/Testing/TestCaseTest.php b/tests/Integration/Testing/TestCaseTest.php new file mode 100644 index 000000000000..b6886cf49c52 --- /dev/null +++ b/tests/Integration/Testing/TestCaseTest.php @@ -0,0 +1,20 @@ + 'anonymous', + ]); + + $this->withoutVite(); + + Vite::asset('foo.png'); + } +}