Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit db1ea0d

Browse files
author
Cristian Gonzalez
committed
[Translation] Modified Translation unit test "testTransWithFallbackLocale"
Now the test shows the behavior when is requested a translation to an undefined locale catalogue and, therefore, the fallbacklocale catalogue must be queried. The original test function only checks the step to reach the language catalog not to the fallbacklocale one (even the fallbacklocale isn't set). This test gives error in the current version of symfony/symfony.
1 parent 381d1e2 commit db1ea0d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/Symfony/Tests/Component/Translation/TranslatorTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ public function testSetFallbackLocale()
4343

4444
public function testTransWithFallbackLocale()
4545
{
46-
$translator = new Translator('en_US', new MessageSelector());
46+
$translator = new Translator('fr_FR', new MessageSelector());
4747
$translator->addLoader('array', new ArrayLoader());
4848
$translator->addResource('array', array('foo' => 'foofoo'), 'en_US');
4949
$translator->addResource('array', array('bar' => 'foobar'), 'en');
5050

51+
$translator->setFallbackLocale('en');
52+
5153
$this->assertEquals('foobar', $translator->trans('bar'));
5254
}
5355

0 commit comments

Comments
 (0)