You are here

public function TranslatorTest::testSetFallbackLocalesMultiple in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/translation/Tests/TranslatorTest.php \Symfony\Component\Translation\Tests\TranslatorTest::testSetFallbackLocalesMultiple()

File

vendor/symfony/translation/Tests/TranslatorTest.php, line 126

Class

TranslatorTest

Namespace

Symfony\Component\Translation\Tests

Code

public function testSetFallbackLocalesMultiple() {
  $translator = new Translator('en');
  $translator
    ->addLoader('array', new ArrayLoader());
  $translator
    ->addResource('array', array(
    'foo' => 'foo (en)',
  ), 'en');
  $translator
    ->addResource('array', array(
    'bar' => 'bar (fr)',
  ), 'fr');

  // force catalogue loading
  $translator
    ->trans('bar');
  $translator
    ->setFallbackLocales(array(
    'fr_FR',
    'fr',
  ));
  $this
    ->assertEquals('bar (fr)', $translator
    ->trans('bar'));
}