/** * Create node by $path and set its value. * * @param string $path separated by slashes * @param string $value * @param bool $overwrite * @return Varien_Simplexml_Config */ public function setNode($path, $value, $overwrite = true) { if ($this->_useCache && $path !== null) { $sectionPath = explode('/', $path); $config = $this->_getSectionConfig($sectionPath); if ($config) { $sectionPath = array_slice($sectionPath, $this->_cacheSections[$sectionPath[0]] + 1); $sectionPath = implode('/', $sectionPath); $config->setNode($sectionPath, $value, $overwrite); } } return parent::setNode($path, $value, $overwrite); }
/** * Mock config */ protected function _mockConfig() { $configObject = new Mage_Core_Model_Config_Base(new Varien_Simplexml_Element('<config></config>')); $configObject->setNode('global/importexport/import_entities/' . $this->_testEntity['node'] . '/model_token', 'Some_Class'); $configObject->setNode('global/importexport/import_entities/' . $this->_testEntity['node'] . '/label', $this->_testEntity['label']); $config = new ReflectionProperty('Mage', '_config'); $config->setAccessible(true); $config->setValue(null, $configObject); }