From d0faf5531d4911f895998acf6233b69199b8fad1 Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Sat, 24 Aug 2013 16:25:01 +0200 Subject: [PATCH] [Locale] Fixed: StubLocale::setDefault() throws no exception when "en" is passed --- src/Symfony/Component/Locale/Stub/StubLocale.php | 4 +++- src/Symfony/Component/Locale/Tests/Stub/StubLocaleTest.php | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Locale/Stub/StubLocale.php b/src/Symfony/Component/Locale/Stub/StubLocale.php index 7465aa28b5..1352f317b3 100644 --- a/src/Symfony/Component/Locale/Stub/StubLocale.php +++ b/src/Symfony/Component/Locale/Stub/StubLocale.php @@ -466,7 +466,9 @@ class StubLocale */ public static function setDefault($locale) { - throw new MethodNotImplementedException(__METHOD__); + if ('en' !== $locale) { + throw new MethodNotImplementedException(__METHOD__); + } } public static function getDataDirectory() diff --git a/src/Symfony/Component/Locale/Tests/Stub/StubLocaleTest.php b/src/Symfony/Component/Locale/Tests/Stub/StubLocaleTest.php index d9e79dc517..e9c1e0f94a 100644 --- a/src/Symfony/Component/Locale/Tests/Stub/StubLocaleTest.php +++ b/src/Symfony/Component/Locale/Tests/Stub/StubLocaleTest.php @@ -252,4 +252,9 @@ class StubLocaleTest extends LocaleTestCase { StubLocale::setDefault('pt_BR'); } + + public function testSetDefaultAcceptsEn() + { + StubLocale::setDefault('en'); + } }