@@ -314,6 +314,41 @@ public function it_does_not_trust_current_request_domain_when_no_sites_are_relat
314314 $ this ->assertFalse (URL ::isExternalToApplication ('http://this-site.com/ ' ));
315315 }
316316
317+ #[Test]
318+ public function it_determines_external_url_to_application_when_site_urls_are_configured_with_antlers ()
319+ {
320+ config (['app.frontend_url ' => 'http://frontend-site.com ' ]);
321+
322+ $ this ->setSites ([
323+ 'en ' => ['name ' => 'English ' , 'locale ' => 'en_US ' , 'url ' => '{{ config:app:frontend_url }} ' ],
324+ 'fr ' => ['name ' => 'French ' , 'locale ' => 'fr_FR ' , 'url ' => '{{ config:app:frontend_url }}/fr ' ],
325+ ]);
326+
327+ $ this ->assertFalse (URL ::isExternalToApplication ('http://frontend-site.com/ ' ));
328+ $ this ->assertFalse (URL ::isExternalToApplication ('http://frontend-site.com/fr/ ' ));
329+ $ this ->assertTrue (URL ::isExternalToApplication ('http://external-site.com/ ' ));
330+ }
331+
332+ #[Test]
333+ public function it_tidies_urls_on_site_hosts_configured_with_antlers ()
334+ {
335+ config (['app.frontend_url ' => 'http://frontend-site.com ' ]);
336+
337+ $ this ->setSites ([
338+ 'en ' => ['name ' => 'English ' , 'locale ' => 'en_US ' , 'url ' => '{{ config:app:frontend_url }} ' ],
339+ 'fr ' => ['name ' => 'French ' , 'locale ' => 'fr_FR ' , 'url ' => '{{ config:app:frontend_url }}/fr ' ],
340+ ]);
341+
342+ $ this ->assertSame ('http://frontend-site.com ' , URL ::tidy ('http://frontend-site.com/ ' ));
343+ $ this ->assertSame ('http://frontend-site.com/fr ' , URL ::tidy ('http://frontend-site.com/fr/ ' ));
344+ $ this ->assertSame ('http://external-site.com/page/ ' , URL ::tidy ('http://external-site.com/page/ ' ));
345+
346+ URL ::enforceTrailingSlashes ();
347+
348+ $ this ->assertSame ('http://frontend-site.com/fr/ ' , URL ::tidy ('http://frontend-site.com/fr ' ));
349+ $ this ->assertSame ('http://external-site.com/page ' , URL ::tidy ('http://external-site.com/page ' ));
350+ }
351+
317352 #[Test]
318353 #[DataProvider('assembleProvider ' )]
319354 public function it_can_assemble_urls ($ segments , $ assembled )
0 commit comments