merged branch bschussek/fix-locale-2.3 (PR #8847)

This PR was merged into the 2.3 branch.

Discussion
----------

[2.3][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        | -

Same as #8846 for 2.3+.

Commits
-------

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

View File

@ -312,6 +312,8 @@ class Locale
*/
public static function setDefault($locale)
{
throw new MethodNotImplementedException(__METHOD__);
if ('en' !== $locale) {
throw new MethodNotImplementedException(__METHOD__);
}
}
}

View File

@ -150,6 +150,11 @@ class LocaleTest extends AbstractLocaleTest
$this->call('setDefault', 'pt_BR');
}
public function testSetDefaultAcceptsEn()
{
$this->call('setDefault', 'en');
}
protected function call($methodName)
{
$args = array_slice(func_get_args(), 1);