File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,6 +160,22 @@ public function test_head_component_without_slot_matches_directive_output_when_s
160160 $ this ->assertSame ($ directive , $ component );
161161 }
162162
163+ public function test_components_do_not_create_cached_view_files_per_request (): void
164+ {
165+ Config::set (['inertia.ssr.enabled ' => true ]);
166+
167+ $ viewCachePath = $ this ->app ['config ' ]['view.compiled ' ];
168+ $ view = '<x-inertia::head><title>Fallback</title></x-inertia::head><x-inertia::app /> ' ;
169+
170+ $ this ->renderView ($ view , ['page ' => self ::EXAMPLE_PAGE_OBJECT ]);
171+ $ cachedViews = glob ($ viewCachePath .'/*.php ' );
172+
173+ $ this ->app ->forgetScopedInstances ();
174+
175+ $ this ->renderView ($ view , ['page ' => ['component ' => 'Different ' , 'props ' => ['foo ' => 'bar ' ]]]);
176+ $ this ->assertSame ($ cachedViews , glob ($ viewCachePath .'/*.php ' ));
177+ }
178+
163179 public function test_ssr_state_is_scoped_and_does_not_leak_between_requests (): void
164180 {
165181 Config::set (['inertia.ssr.enabled ' => true ]);
You can’t perform that action at this time.
0 commit comments