Пример #1
0
 public function testIsTranslated()
 {
     $adapter = new Adapter\ArrayAdapter(dirname(__FILE__) . '/_files/translation_en.php', 'en');
     $this->assertTrue($adapter->isTranslated('Message 1'));
     $this->assertFalse($adapter->isTranslated('Message 6'));
     $this->assertTrue($adapter->isTranslated('Message 1', true));
     $this->assertFalse($adapter->isTranslated('Message 1', true, 'en_US'));
     $this->assertTrue($adapter->isTranslated('Message 1', false, 'en_US'));
     $this->assertFalse($adapter->isTranslated('Message 1', false, 'es'));
     $this->assertFalse($adapter->isTranslated('Message 1', 'es'));
     $this->assertFalse($adapter->isTranslated('Message 1', 'xx_XX'));
     $this->assertTrue($adapter->isTranslated('Message 1', 'en_XX'));
 }