@@ -142,6 +142,45 @@ public function it_maps_a_custom_domain_to_each_locale()
142
142
$ this ->assertEquals ('/ ' , $ route ->uri );
143
143
}
144
144
145
+ /** @test */
146
+ public function it_registers_routes_in_the_correct_order_without_prefix_for_a_configured_main_locale_with_domains ()
147
+ {
148
+ $ this ->setSupportedLocales ([
149
+ 'en ' => 'english-domain.com ' ,
150
+ 'nl ' => 'dutch-domain.com ' ,
151
+ ]);
152
+ $ this ->setOmitUrlPrefixForLocale ('en ' );
153
+
154
+ Route::localized (function () {
155
+ Route::get ('/ ' , function () { return 'Home ' .App::getLocale (); })->name ('home ' );
156
+ Route::get ('{slug} ' , function () { return 'Dynamic ' .App::getLocale (); })->name ('catch-all ' );
157
+ });
158
+
159
+ $ routes = $ this ->getRoutes ();
160
+
161
+ $ this ->assertCount (4 , $ routes );
162
+
163
+ $ route = $ routes [0 ];
164
+ $ this ->assertEquals ('english-domain.com ' , $ route ->action ['domain ' ]);
165
+ $ this ->assertEquals ('en.home ' , $ route ->action ['as ' ]);
166
+ $ this ->assertEquals ('/ ' , $ route ->uri );
167
+
168
+ $ route = $ routes [1 ];
169
+ $ this ->assertEquals ('english-domain.com ' , $ route ->action ['domain ' ]);
170
+ $ this ->assertEquals ('en.catch-all ' , $ route ->action ['as ' ]);
171
+ $ this ->assertEquals ('{slug} ' , $ route ->uri );
172
+
173
+ $ route = $ routes [2 ];
174
+ $ this ->assertEquals ('dutch-domain.com ' , $ route ->action ['domain ' ]);
175
+ $ this ->assertEquals ('nl.home ' , $ route ->action ['as ' ]);
176
+ $ this ->assertEquals ('/ ' , $ route ->uri );
177
+
178
+ $ route = $ routes [3 ];
179
+ $ this ->assertEquals ('dutch-domain.com ' , $ route ->action ['domain ' ]);
180
+ $ this ->assertEquals ('nl.catch-all ' , $ route ->action ['as ' ]);
181
+ $ this ->assertEquals ('{slug} ' , $ route ->uri );
182
+ }
183
+
145
184
/** @test */
146
185
public function it_temporarily_changes_the_app_locale_when_registering_the_routes ()
147
186
{
0 commit comments