File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -218,4 +218,28 @@ public function the_macro_does_not_blow_up_on_a_default_404_error()
218218 $ response ->assertNotFound ();
219219 $ response ->assertResponseHasNoView ();
220220 }
221+
222+ /** @test */
223+ public function it_returns_localized_urls_for_non_existing_routes_that_have_a_supported_locale_in_their_url_if_you_register_a_fallback_route ()
224+ {
225+ $ this ->setSupportedLocales (['en ' , 'nl ' ]);
226+
227+ Route::localized (function () {
228+ Route::fallback (function () {
229+ return response ([
230+ 'current ' => Route::localizedUrl (),
231+ 'en ' => Route::localizedUrl ('en ' ),
232+ 'nl ' => Route::localizedUrl ('nl ' ),
233+ ], 404 );
234+ })->name ('404 ' );
235+ });
236+
237+ $ response = $ this ->call ('GET ' , '/nl/non/existing/route ' );
238+ $ response ->assertNotFound ();
239+ $ this ->assertEquals ([
240+ 'current ' => url ('/nl/non/existing/route ' ),
241+ 'en ' => url ('/en/non/existing/route ' ),
242+ 'nl ' => url ('/nl/non/existing/route ' ),
243+ ], $ response ->original );
244+ }
221245}
You can’t perform that action at this time.
0 commit comments