public function TranslatorTest::testSetFallbackLocales in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/translation/Tests/TranslatorTest.php \Symfony\Component\Translation\Tests\TranslatorTest::testSetFallbackLocales()
File
- vendor/
symfony/ translation/ Tests/ TranslatorTest.php, line 112
Class
Namespace
Symfony\Component\Translation\TestsCode
public function testSetFallbackLocales() {
$translator = new Translator('en');
$translator
->addLoader('array', new ArrayLoader());
$translator
->addResource('array', array(
'foo' => 'foofoo',
), 'en');
$translator
->addResource('array', array(
'bar' => 'foobar',
), 'fr');
// force catalogue loading
$translator
->trans('bar');
$translator
->setFallbackLocales(array(
'fr',
));
$this
->assertEquals('foobar', $translator
->trans('bar'));
}