/** * Initialize the fixture. * * @return null */ protected function setUp() { $this->_aBackup['_SERVER'] = $_SERVER; $this->_aBackup['_POST'] = $_POST; $this->_aBackup['_GET'] = $_GET; $this->_aBackup['_SESSION'] = $_SESSION; $this->_aBackup['_COOKIE'] = $_COOKIE; parent::setUp(); error_reporting(E_ALL ^ E_NOTICE | E_STRICT); ini_set('display_errors', true); $this->getConfig(); $this->getSession(); $this->setAdminMode(false); $this->setShopId(null); oxAddClassModule('modOxUtilsDate', 'oxUtilsDate'); oxUtils::getInstance()->cleanStaticCache(); error_reporting(E_ALL ^ E_NOTICE | E_STRICT); ini_set('display_errors', true); // initiating the modules oxTestModuleLoader::loadModule(); }
<?php // whether to use the original "aModules" chain from the shop // methods like "initFromMetadata" and "addChain" will append data to the original chain oxTestModuleLoader::useOriginalChain(false); // Loads other module classes as dependencies // oxTestModuleLoader::addDependencies(array( // "path/to/the/module" // )); // initiates the module from the metadata file // does nothing if metadata file is not found oxTestModuleLoader::initFromMetadata(); // appends the module extension chain with the given module files oxTestModuleLoader::append(array());
public static function _appendToChain($aExtend) { // if the chain is still empty and "original" chain is needed if (self::$_blOriginal && !count(self::$_aChain)) { self::$_aChain = (array) modConfig::getInstance()->getConfigParam("aModules"); } // addping the "extend" chain to the main chain foreach ($aExtend as $sParent => $sExtends) { if (isset(self::$_aChain[$sParent])) { $sExtends = trim(self::$_aChain[$sParent], "& ") . "&" . trim($sExtends, "& "); } self::$_aChain[$sParent] = $sExtends; } }