Skip to content

Commit 698a891

Browse files
authored
[9.x] Fix withoutVite (#43826)
* [9.x] Fix withoutVite * Cleanup
1 parent 3d068ab commit 698a891

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,31 @@ public function __call($name, $arguments)
121121
return '';
122122
}
123123

124+
public function __toString()
125+
{
126+
return '';
127+
}
128+
124129
public function useIntegrityKey()
125130
{
126131
return $this;
127132
}
128133

134+
public function useBuildDirectory()
135+
{
136+
return $this;
137+
}
138+
139+
public function useHotFile()
140+
{
141+
return $this;
142+
}
143+
144+
public function withEntryPoints()
145+
{
146+
return $this;
147+
}
148+
129149
public function useScriptTagAttributes()
130150
{
131151
return $this;

tests/Foundation/Testing/Concerns/InteractsWithContainerTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ public function testWithoutViteHandlesReactRefresh()
2525
$this->assertSame($this, $instance);
2626
}
2727

28+
public function testWithoutViteHandlesAsset()
29+
{
30+
$instance = $this->withoutVite();
31+
32+
$this->assertSame('', app(Vite::class)->asset('path/to/asset.png'));
33+
$this->assertSame($this, $instance);
34+
}
35+
2836
public function testWithViteRestoresOriginalHandlerAndReturnsInstance()
2937
{
3038
$handler = new stdClass;

0 commit comments

Comments
 (0)