/** * Test case */ public function testConfigReadBase() { $this->setExpectedException('Enlight_Config_Exception'); $adapter = new Enlight_Config_Adapter_File(array('configDir' => '/fail', 'namePrefix' => 's_', 'skipExtends' => false, 'configType' => 'ini')); $config = new Enlight_Config('test', array('adapter' => $adapter)); $config->setData(array('test' => true)); $config->write(); }
/** * Saves the Form using an Enlight_Config_Adapter to do so. * This is a rudimentary implementation and should be considered as beta * * @return Enlight_Components_Form */ public function write() { $this->_adapter->setData($this->toArray()); $this->_adapter->write(); return $this; }
/** * Test case */ public function testConfigNamePrefix() { $dir = Enlight_TestHelper::Instance()->TestPath('TempFiles'); $adapter = new Enlight_Config_Adapter_File(array('configDir' => $dir, 'namePrefix' => 's_', 'skipExtends' => false, 'configType' => 'ini')); $config = new Enlight_Config('test', array('adapter' => $adapter)); $config->setData(array('test' => true)); $config->write(); $this->assertFileExists($dir . 's_test' . '.ini'); }