/** * 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(); }
/** * 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); }
/** * 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()); }
/** * 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'); }