Exemple #1
0
 public function testOptions()
 {
     $adapter = new Zend_Translate_Adapter_Tbx(dirname(__FILE__) . '/_files/translation_en.tbx', 'en');
     $adapter->setOptions(array('testoption' => 'testkey'));
     $this->assertEquals(array('testoption' => 'testkey', 'clear' => false, 'scan' => null, 'locale' => 'en'), $adapter->getOptions());
     $this->assertEquals('testkey', $adapter->getOptions('testoption'));
     $this->assertTrue(is_null($adapter->getOptions('nooption')));
 }
Exemple #2
0
 public function testOptions()
 {
     $adapter = new Zend_Translate_Adapter_Tbx(dirname(__FILE__) . '/_files/translation_en.tbx', 'en');
     $adapter->setOptions(array('testoption' => 'testkey'));
     $expected = array('testoption' => 'testkey', 'clear' => false, 'content' => dirname(__FILE__) . '/_files/translation_en.tbx', 'scan' => null, 'locale' => 'en', 'ignore' => '.', 'disableNotices' => false, 'log' => false, 'logMessage' => 'Untranslated message within \'%locale%\': %message%', 'logUntranslated' => false, 'reload' => false);
     $options = $adapter->getOptions();
     foreach ($expected as $key => $value) {
         $this->assertArrayHasKey($key, $options);
         $this->assertEquals($value, $options[$key]);
     }
     $this->assertEquals('testkey', $adapter->getOptions('testoption'));
     $this->assertTrue(is_null($adapter->getOptions('nooption')));
 }
Exemple #3
0
 public function testOptions()
 {
     $adapter = new Zend_Translate_Adapter_Tbx(dirname(__FILE__) . '/_files/translation_en.tbx', 'en');
     $adapter->setOptions(array('testoption' => 'testkey'));
     $this->assertEquals(array('testoption' => 'testkey', 'clear' => false, 'scan' => null, 'locale' => 'en', 'ignore' => '.', 'disableNotices' => false, 'log' => false, 'logMessage' => 'Untranslated message within \'%locale%\': %message%', 'logUntranslated' => false, 'reload' => false), $adapter->getOptions());
     $this->assertEquals('testkey', $adapter->getOptions('testoption'));
     $this->assertTrue(is_null($adapter->getOptions('nooption')));
 }