From db1ea0d2e1147631d21a87f2eb58c6e7a00334a0 Mon Sep 17 00:00:00 2001 From: Cristian Gonzalez Date: Sun, 27 Feb 2011 12:12:45 +0100 Subject: [PATCH] [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. --- tests/Symfony/Tests/Component/Translation/TranslatorTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Symfony/Tests/Component/Translation/TranslatorTest.php b/tests/Symfony/Tests/Component/Translation/TranslatorTest.php index c45f1df90e..4cddae8a18 100644 --- a/tests/Symfony/Tests/Component/Translation/TranslatorTest.php +++ b/tests/Symfony/Tests/Component/Translation/TranslatorTest.php @@ -43,11 +43,13 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase public function testTransWithFallbackLocale() { - $translator = new Translator('en_US', new MessageSelector()); + $translator = new Translator('fr_FR', new MessageSelector()); $translator->addLoader('array', new ArrayLoader()); $translator->addResource('array', array('foo' => 'foofoo'), 'en_US'); $translator->addResource('array', array('bar' => 'foobar'), 'en'); + $translator->setFallbackLocale('en'); + $this->assertEquals('foobar', $translator->trans('bar')); }