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:
commit
fcb51c97dd
@ -312,6 +312,8 @@ class Locale
|
||||
*/
|
||||
public static function setDefault($locale)
|
||||
{
|
||||
throw new MethodNotImplementedException(__METHOD__);
|
||||
if ('en' !== $locale) {
|
||||
throw new MethodNotImplementedException(__METHOD__);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user