_bootstrap = $bootstrap; } /** * Retrieve application installation directory * * @return string */ public function getAppTempDir() { return $this->_bootstrap->getApplication()->getTempDir(); } /** * Retrieve application initialization options * * @return array */ public function getAppInitParams() { return $this->_bootstrap->getApplication()->getInitParams(); } /** * Reinitialize the application instance optionally passing parameters to be overridden. * Intended to be used for the tests isolation purposes. * * @param array $overriddenParams */ public function reinitialize(array $overriddenParams = []) { $this->_bootstrap->getApplication()->reinitialize($overriddenParams); } /** * Perform the full request processing by the application instance. * Intended to be used by the controller tests. */ public function runApp() { $this->_bootstrap->getApplication()->run(); } /** * Retrieve object manager * * @return \Magento\Framework\ObjectManagerInterface */ public static function getObjectManager() { return self::$_objectManager; } /** * Set object manager * * @param \Magento\Framework\ObjectManagerInterface $objectManager */ public static function setObjectManager(\Magento\Framework\ObjectManagerInterface $objectManager) { self::$_objectManager = $objectManager; } /** * Get bootstrap object * * @return \Magento\TestFramework\Bootstrap */ public function getBootstrap() { return $this->_bootstrap; } /** * Load area * @param string $areaCode */ public function loadArea($areaCode) { self::$_objectManager->get('Magento\Framework\App\State')->setAreaCode($areaCode); self::$_objectManager->get('Magento\Framework\App\AreaList')->getArea($areaCode)->load(); } }