@@ -166,10 +166,12 @@ public function errors_are_flashed_and_cleared_after_next_request(): void
166166 // First access - errors exist
167167 $ this ->assertTrue ($ this ->formSession ->hasErrors ());
168168
169- // Simulate cleanup after request
169+ // Start of the next request: still available to display.
170170 $ this ->session ->cleanup ();
171+ $ this ->assertTrue ($ this ->formSession ->hasErrors ());
171172
172- // Second access - errors cleared
173+ // Start of the request after that: cleared.
174+ $ this ->session ->cleanup ();
173175 $ this ->assertFalse ($ this ->formSession ->hasErrors ());
174176 }
175177
@@ -183,10 +185,12 @@ public function values_are_flashed_and_cleared_after_next_request(): void
183185 // First access - values exist
184186 $ this ->assertEquals ('John Doe ' , $ this ->formSession ->getOriginalValueFor ('name ' ));
185187
186- // Simulate cleanup after request
188+ // Start of the next request: still available to display.
187189 $ this ->session ->cleanup ();
190+ $ this ->assertEquals ('John Doe ' , $ this ->formSession ->getOriginalValueFor ('name ' ));
188191
189- // Second access - values cleared
192+ // Start of the request after that: cleared.
193+ $ this ->session ->cleanup ();
190194 $ this ->assertEquals ('' , $ this ->formSession ->getOriginalValueFor ('name ' ));
191195 }
192196}
0 commit comments