Beispiel #1
0
 public function testOptions()
 {
     $adapter = new Adapter\Csv(dirname(__FILE__) . '/_files/translation_en.csv', 'en');
     $adapter->setOptions(array('testoption' => 'testkey'));
     $this->assertEquals(array('delimiter' => ';', 'testoption' => 'testkey', 'clear' => false, 'scan' => null, 'locale' => 'en', 'length' => 0, 'enclosure' => '"', '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')));
 }
Beispiel #2
0
 public function testOptions()
 {
     $adapter = new Adapter\Csv(__DIR__ . '/_files/translation_en.csv', 'en');
     $adapter->setOptions(array('testoption' => 'testkey'));
     $expected = array('delimiter' => ';', 'testoption' => 'testkey', 'clear' => false, 'content' => __DIR__ . '/_files/translation_en.csv', 'scan' => null, 'locale' => 'en', 'length' => 0, 'enclosure' => '"', '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')));
 }