public function testExecuteWithException() { $objectMock = $this->getMockBuilder('Magento\\Framework\\DataObject')->disableOriginalConstructor()->getMock(); $this->transactionMock->expects($this->once())->method('getResponseObject')->willReturn($objectMock); $this->responseValidatorMock->expects($this->once())->method('validate')->with($objectMock)->willThrowException(new \Magento\Framework\Exception\LocalizedException(__('Error'))); $this->coreRegistryMock->expects($this->once())->method('register')->with('transparent_form_params', $this->arrayHasKey('error')); $this->resultLayoutMock->expects($this->once())->method('addDefaultHandle')->willReturnSelf(); $this->resultLayoutMock->expects($this->once())->method('getLayout')->willReturn($this->getLayoutMock()); $this->assertInstanceOf('\\Magento\\Framework\\Controller\\ResultInterface', $this->object->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); } }