From 11e5a1a1dc146a50e07eb280925691c8bdc7155c Mon Sep 17 00:00:00 2001 From: James Date: Mon, 7 Nov 2022 16:33:49 +1000 Subject: [PATCH 1/3] fix: update Vite mock to return empty array for preloadedAssets --- .../Testing/Concerns/InteractsWithContainer.php | 4 ++++ .../Testing/Concerns/InteractsWithContainerTest.php | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php index 67f2b298ddfd..df4f420c23ff 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php +++ b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php @@ -135,6 +135,10 @@ public function useStyleTagAttributes() { return $this; } + + public function preloadedAssets() { + return []; + } }); return $this; diff --git a/tests/Foundation/Testing/Concerns/InteractsWithContainerTest.php b/tests/Foundation/Testing/Concerns/InteractsWithContainerTest.php index 63d0a28c642e..0c218855b9f9 100644 --- a/tests/Foundation/Testing/Concerns/InteractsWithContainerTest.php +++ b/tests/Foundation/Testing/Concerns/InteractsWithContainerTest.php @@ -37,6 +37,14 @@ public function testWithViteRestoresOriginalHandlerAndReturnsInstance() $this->assertSame($this, $instance); } + public function testWithoutViteReturnsEmptyArrayForPreloadedAssets(): void + { + $instance = $this->withoutVite(); + + $this->assertSame([], app(Vite::class)->preloadedAssets()); + $this->assertSame($this, $instance); + } + public function testWithoutMixBindsEmptyHandlerAndReturnsInstance() { $instance = $this->withoutMix(); From 562df5385d066e1521681000bb8070e6c737edf8 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 7 Nov 2022 16:47:42 +1000 Subject: [PATCH 2/3] chore: fix code style --- .../Foundation/Testing/Concerns/InteractsWithContainer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php index df4f420c23ff..0a84acaccdf7 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php +++ b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php @@ -136,7 +136,8 @@ public function useStyleTagAttributes() return $this; } - public function preloadedAssets() { + public function preloadedAssets() + { return []; } }); From bac271d7da5a573f304ed559bfb964edbb1bd0c6 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 7 Nov 2022 17:23:03 +1000 Subject: [PATCH 3/3] Trigger tests to re-run