merged branch bschussek/fix-locale-2.2 (PR #8846)

This PR was merged into the 2.2 branch.

Discussion
----------

[2.2][Locale] Fixed: StubLocale::setDefault() throws no exception when "en" is passed

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This is necessary to fix `IntlTestHelper::requireIntl()` when ICU is not installed and the Icu component 1.0.0 is used instead. In that case, `IntlTestHelper::requireIntl()` calls `\Locale::setDefault('en')` and fails. Consequently, the Form component test cases are partially red when running without ICU installed.

This PR fixes that.

Commits
-------

d0faf55 [Locale] Fixed: StubLocale::setDefault() throws no exception when "en" is passed
This commit is contained in:
Fabien Potencier 2013-08-24 17:25:11 +02:00
commit ebf3ceca56
2 changed files with 8 additions and 1 deletions

View File

@ -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()

View File

@ -252,4 +252,9 @@ class StubLocaleTest extends LocaleTestCase
{
StubLocale::setDefault('pt_BR');
}
public function testSetDefaultAcceptsEn()
{
StubLocale::setDefault('en');
}
}