Пример #1
0
 public function testLoaderLoadsFromPhar()
 {
     $loader = new PhpArrayLoader();
     $loader->setUseIncludePath(true);
     $textDomain = $loader->load('en_EN', 'phar://' . $this->testFilesDir . '/translations.phar/translation_en.php');
     $this->assertEquals('Message 1 (en)', $textDomain['Message 1']);
     $this->assertEquals('Message 4 (en)', $textDomain['Message 4']);
 }
Пример #2
0
 public function testLoaderLoadsPluralRules()
 {
     $loader = new PhpArrayLoader();
     $domain = $loader->load($this->testFilesDir . '/translation_en.php', 'en_EN');
     $this->assertEquals(2, $domain->getPluralRule()->evaluate(0));
     $this->assertEquals(0, $domain->getPluralRule()->evaluate(1));
     $this->assertEquals(1, $domain->getPluralRule()->evaluate(2));
     $this->assertEquals(2, $domain->getPluralRule()->evaluate(10));
 }