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

Conflicts:
	src/Symfony/Component/Locale/Stub/StubLocale.php
	src/Symfony/Component/Locale/Tests/Stub/StubLocaleTest.php
This commit is contained in:
Bernhard Schussek 2013-08-24 16:25:01 +02:00
parent 6610a7c80e
commit e1f40f28c5
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);