/** * @covers \Magento\Sales\Controller\Adminhtml\Order\View::executeInternal */ public function testGlobalException() { $id = 111; $exception = new \Exception(); $this->initOrder(); $this->initOrderSuccess($id); $this->prepareRedirect(); $this->resultPageFactoryMock->expects($this->once()) ->method('create') ->willThrowException($exception); $this->loggerMock->expects($this->once()) ->method('critical') ->with($exception); $this->messageManagerMock->expects($this->once()) ->method('addError') ->with('Exception occurred during order load') ->willReturnSelf(); $this->setPath('sales/order/index'); $this->assertInstanceOf( 'Magento\Backend\Model\View\Result\Redirect', $this->viewAction->executeInternal() ); }
/** * {@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); } }
/** * {@inheritdoc} */ public function getResponse() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getResponse'); if (!$pluginInfo) { return parent::getResponse(); } else { return $this->___callPlugins('getResponse', func_get_args(), $pluginInfo); } }