8000 [Locale] Fixed: StubLocale::setDefault() throws no exception when "en… · enumag/symfony@d0faf55 · GitHub
[go: up one dir, main page]

Skip to content

Commit d0faf55

Browse files
committed
[Locale] Fixed: StubLocale::setDefault() throws no exception when "en" is passed
1 parent b2cbc67 commit d0faf55

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/Symfony/Component/Locale/Stub/StubLocale.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,9 @@ public static function parseLocale($locale)
466466
*/
467467
public static function setDefault($locale)
468468
{
469-
throw new MethodNotImplementedException(__METHOD__);
469+
if ('en' !== $locale) {
470+
throw new MethodNotImplementedException(__METHOD__);
471+
}
470472
}
471473

472474
public static function getDataDirectory()

src/Symfony/Component/Locale/Tests/Stub/StubLocaleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,4 +252,9 @@ public function testSetDefault()
252252
{
253253
StubLocale::setDefault('pt_BR');
254254
}
255+
256+
public function testSetDefaultAcceptsEn()
257+
{
258+
StubLocale::setDefault('en');
259+
}
255260
}

0 commit comments

Comments
 (0)
0