/** * Load primary config * * @param \Magento\Framework\App\Filesystem\DirectoryList $directoryList * @param DriverPool $driverPool * @param mixed $argumentMapper * @param string $appMode * @return array */ protected function _loadPrimaryConfig(DirectoryList $directoryList, $driverPool, $argumentMapper, $appMode) { if (null === $this->_primaryConfigData) { $this->_primaryConfigData = array_replace(parent::_loadPrimaryConfig($directoryList, $driverPool, $argumentMapper, $appMode), ['default_setup' => ['type' => 'Magento\\TestFramework\\Db\\ConnectionAdapter']]); $this->_primaryConfigData['preferences'] = array_replace($this->_primaryConfigData['preferences'], ['Magento\\Framework\\Stdlib\\CookieManagerInterface' => 'Magento\\TestFramework\\CookieManager', 'Magento\\Framework\\ObjectManager\\DynamicConfigInterface' => '\\Magento\\TestFramework\\ObjectManager\\Configurator', 'Magento\\Framework\\App\\RequestInterface' => 'Magento\\TestFramework\\Request', 'Magento\\Framework\\App\\Request\\Http' => 'Magento\\TestFramework\\Request', 'Magento\\Framework\\App\\ResponseInterface' => 'Magento\\TestFramework\\Response', 'Magento\\Framework\\App\\Response\\Http' => 'Magento\\TestFramework\\Response', 'Magento\\Framework\\Interception\\PluginListInterface' => 'Magento\\TestFramework\\Interception\\PluginList', 'Magento\\Framework\\Interception\\ObjectManager\\Config' => 'Magento\\TestFramework\\ObjectManager\\Config', 'Magento\\Framework\\View\\LayoutInterface' => 'Magento\\TestFramework\\View\\Layout', 'Magento\\Framework\\App\\Resource\\ConnectionAdapterInterface' => 'Magento\\TestFramework\\Db\\ConnectionAdapter']); } return $this->_primaryConfigData; }
/** * Load primary config * * @param \Magento\Framework\App\Filesystem\DirectoryList $directoryList * @param DriverPool $driverPool * @param mixed $argumentMapper * @param string $appMode * @return array */ protected function _loadPrimaryConfig(DirectoryList $directoryList, $driverPool, $argumentMapper, $appMode) { if (null === $this->_primaryConfigData) { $this->_primaryConfigData = array_replace(parent::_loadPrimaryConfig($directoryList, $driverPool, $argumentMapper, $appMode), ['default_setup' => ['type' => 'Magento\\TestFramework\\Db\\ConnectionAdapter']]); $diPreferences = []; $diPreferencesPath = __DIR__ . '/../../../etc/di/preferences/'; $preferenceFiles = glob($diPreferencesPath . '*.php'); foreach ($preferenceFiles as $file) { if (!is_readable($file)) { throw new LocalizedException(__("'%1' is not readable file.", $file)); } $diPreferences = array_replace($diPreferences, include $file); } $this->_primaryConfigData['preferences'] = array_replace($this->_primaryConfigData['preferences'], $diPreferences); } return $this->_primaryConfigData; }
/** * Load primary config * * @param \Magento\Framework\App\Filesystem\DirectoryList $directoryList * @param mixed $argumentMapper * @param string $appMode * @return array */ protected function _loadPrimaryConfig(\Magento\Framework\App\Filesystem\DirectoryList $directoryList, $argumentMapper, $appMode) { if (null === $this->_primaryConfigData) { $this->_primaryConfigData = array_replace(parent::_loadPrimaryConfig($directoryList, $argumentMapper, $appMode), array('default_setup' => array('type' => 'Magento\\TestFramework\\Db\\ConnectionAdapter'))); $this->_primaryConfigData['preferences'] = array_replace($this->_primaryConfigData['preferences'], ['Magento\\Framework\\Stdlib\\Cookie' => 'Magento\\TestFramework\\Cookie', 'Magento\\Framework\\App\\RequestInterface' => 'Magento\\TestFramework\\Request', 'Magento\\Framework\\App\\Request\\Http' => 'Magento\\TestFramework\\Request', 'Magento\\Framework\\App\\ResponseInterface' => 'Magento\\TestFramework\\Response', 'Magento\\Framework\\App\\Response\\Http' => 'Magento\\TestFramework\\Response', 'Magento\\Framework\\Interception\\PluginList' => 'Magento\\TestFramework\\Interception\\PluginList', 'Magento\\Framework\\Interception\\ObjectManager\\Config' => 'Magento\\TestFramework\\ObjectManager\\Config', 'Magento\\Framework\\View\\LayoutInterface' => 'Magento\\TestFramework\\View\\Layout']); } return $this->_primaryConfigData; }