Skip to content

Commit 88c29bc

Browse files
IncomingRequest: Test if setLocale will match a listed but non-default supportedLocale if country included
1 parent 4da485d commit 88c29bc

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/system/HTTP/IncomingRequestTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,19 @@ public function testSetBadLocale(): void
223223
$this->assertSame('es', $request->getLocale());
224224
}
225225

226+
public function testSetBroadLocale(): void
227+
{
228+
$config = new App();
229+
$config->supportedLocales = ['en', 'fr'];
230+
$config->defaultLocale = 'en';
231+
$config->baseURL = 'http://example.com/';
232+
233+
$request = $this->createRequest($config);
234+
235+
$request->setLocale('fr-FR');
236+
$this->assertSame('fr', $request->getLocale());
237+
}
238+
226239
public function testSetValidLocales(): void
227240
{
228241
$config = new App();

0 commit comments

Comments
 (0)