You are here

public function MoFileLoaderTest::testLoadPlurals in Zircon Profile 8

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

File

vendor/symfony/translation/Tests/Loader/MoFileLoaderTest.php, line 30

Class

MoFileLoaderTest

Namespace

Symfony\Component\Translation\Tests\Loader

Code

public function testLoadPlurals() {
  $loader = new MoFileLoader();
  $resource = __DIR__ . '/../fixtures/plurals.mo';
  $catalogue = $loader
    ->load($resource, 'en', 'domain1');
  $this
    ->assertEquals(array(
    'foo' => 'bar',
    'foos' => '{0} bar|{1} bars',
  ), $catalogue
    ->all('domain1'));
  $this
    ->assertEquals('en', $catalogue
    ->getLocale());
  $this
    ->assertEquals(array(
    new FileResource($resource),
  ), $catalogue
    ->getResources());
}