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:
commit
ebf3ceca56
@ -466,8 +466,10 @@ class StubLocale
|
|||||||
*/
|
*/
|
||||||
public static function setDefault($locale)
|
public static function setDefault($locale)
|
||||||
{
|
{
|
||||||
|
if ('en' !== $locale) {
|
||||||
throw new MethodNotImplementedException(__METHOD__);
|
throw new MethodNotImplementedException(__METHOD__);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static function getDataDirectory()
|
public static function getDataDirectory()
|
||||||
{
|
{
|
||||||
|
@ -252,4 +252,9 @@ class StubLocaleTest extends LocaleTestCase
|
|||||||
{
|
{
|
||||||
StubLocale::setDefault('pt_BR');
|
StubLocale::setDefault('pt_BR');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSetDefaultAcceptsEn()
|
||||||
|
{
|
||||||
|
StubLocale::setDefault('en');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user