Esempio n. 1
0
 /**
  * Test case
  */
 public function testConfigWriteFile()
 {
     $this->setExpectedException('Enlight_Config_Exception');
     $adapter = new Enlight_Config_Adapter_File(array('configDir' => '/fail', 'nameSuffix' => '.txt', 'skipExtends' => false, 'configType' => 'ini'));
     $config = new Enlight_Config('test', array('adapter' => $adapter));
     $config->setData(array('test' => true));
     $config->setSection('test');
     $config->write();
 }
Esempio n. 2
0
 /**
  * If there is a snippet missing, set the shopID and localeID to the main shop since all
  * language shops derive from it.
  *
  * @param \Enlight_Config $config
  */
 private function overwriteWithDefaultShopValues(\Enlight_Config $config)
 {
     $section = $config->getSection();
     foreach ($this->_sectionColumn as $key => $columnName) {
         switch ($columnName) {
             case 'shopID':
             case 'localeID':
                 $section[$key] = 1;
                 break;
         }
     }
     $config->setSection($section);
 }
Esempio n. 3
0
 /**
  * Test case
  */
 public function testSetExtendsString()
 {
     $config = new Enlight_Config(array());
     $config->setSection('test');
     $config->setExtends('default');
     $testExtends = array('test' => 'default');
     $this->assertEquals($testExtends, $config->getExtends());
 }
Esempio n. 4
0
 /**
  * Test case
  */
 public function testConfigNameSuffix()
 {
     $dir = Enlight_TestHelper::Instance()->TestPath('TempFiles');
     $adapter = new Enlight_Config_Adapter_File(array('configDir' => $dir, 'nameSuffix' => '.txt', 'skipExtends' => false, 'configType' => 'ini'));
     $config = new Enlight_Config('test', array('adapter' => $adapter));
     $config->setData(array('test' => true));
     $config->setSection('test');
     $config->write();
     $this->assertFileExists($dir . 'test' . '.txt');
 }