You are here

public function TranslatorTest::testTransValidLocale in Zircon Profile 8

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

@dataProvider getValidLocalesTests

File

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

Class

TranslatorTest

Namespace

Symfony\Component\Translation\Tests

Code

public function testTransValidLocale($locale) {
  $translator = new Translator($locale, new MessageSelector());
  $translator
    ->addLoader('array', new ArrayLoader());
  $translator
    ->addResource('array', array(
    'test' => 'OK',
  ), $locale);
  $this
    ->assertEquals('OK', $translator
    ->trans('test'));
  $this
    ->assertEquals('OK', $translator
    ->trans('test', array(), null, $locale));
}