/** * Run app * * @throws \Exception|\Magelight\Exception */ public function run() { try { \Magelight\Event\Manager::getInstance()->dispatchEvent('app_start', []); $request = \Magelight\Http\Request::getInstance(); $action = \Magelight\Components\Router::getInstance($this)->getAction((string) $request->getRequestRoute()); $request->appendGet($action['arguments']); $this->dispatchAction($action); } catch (\Exception $e) { \Magelight\Log::getInstance()->add($e->getMessage()); if ($this->developerMode) { throw $e; } } }
/** * Set up before test */ public function setUp() { $this->app = $this->getMockForAbstractClass(App::class, [], '', false, false, true, []); $this->modulesMock = $this->getMock(\Magelight\Components\Modules::class, [], [], '', false); $this->configMock = $this->getMock(\Magelight\Config::class, [], [], '', false); $this->routerMock = $this->getMock(\Magelight\Components\Router::class, [], [], '', false); $this->sessionMock = $this->getMock(\Magelight\Http\Session::class, [], [], '', false); $this->translatorMock = $this->getMock(\Magelight\I18n\Translator::class, [], [], '', false); $this->eventManagerMock = $this->getMock(\Magelight\Event\Manager::class, [], [], '', false); \Magelight\Components\Modules::forgeMock($this->modulesMock); \Magelight\Config::forgeMock($this->configMock); \Magelight\Components\Router::forgeMock($this->routerMock); \Magelight\Http\Session::forgeMock($this->sessionMock); \Magelight\I18n\Translator::forgeMock($this->translatorMock); \Magelight\Event\Manager::forgeMock($this->eventManagerMock); }