/** * @return void */ public function testExecuteWithLocalizedException() { $errorText = new Phrase('Error'); $this->messageManagerMock->expects($this->once())->method('addError')->with($errorText); $this->menuBlockMock->expects($this->once())->method('setActive')->willThrowException(new \Magento\Framework\Exception\LocalizedException($errorText)); $this->viewed->execute(); }
/** * {@inheritdoc} */ public function dispatch(\Magento\Framework\App\RequestInterface $request) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'dispatch'); if (!$pluginInfo) { return parent::dispatch($request); } else { return $this->___callPlugins('dispatch', func_get_args(), $pluginInfo); } }