Skip to content

Commit 29430b4

Browse files
authored
[9.x] Update Vite mock to return empty array for preloadedAssets (#44858)
* fix: update Vite mock to return empty array for preloadedAssets * chore: fix code style * Trigger tests to re-run
1 parent e5398e7 commit 29430b4

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ public function useStyleTagAttributes()
156156
{
157157
return $this;
158158
}
159+
160+
public function preloadedAssets()
161+
{
162+
return [];
163+
}
159164
});
160165

161166
return $this;

tests/Foundation/Testing/Concerns/InteractsWithContainerTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ public function testWithViteRestoresOriginalHandlerAndReturnsInstance()
4545
$this->assertSame($this, $instance);
4646
}
4747

48+
public function testWithoutViteReturnsEmptyArrayForPreloadedAssets(): void
49+
{
50+
$instance = $this->withoutVite();
51+
52+
$this->assertSame([], app(Vite::class)->preloadedAssets());
53+
$this->assertSame($this, $instance);
54+
}
55+
4856
public function testWithoutMixBindsEmptyHandlerAndReturnsInstance()
4957
{
5058
$instance = $this->withoutMix();

0 commit comments

Comments
 (0)