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