/** * @param $paymentMethod * @param $controller * @param $quoteId * @param $result * @dataProvider textExecuteFailedPlaceOrderDataProvider */ public function testExecuteFailedPlaceOrder($paymentMethod, $controller, $quoteId, $result) { $this->requestMock->expects($this->at(0))->method('getParam')->with('payment')->will($this->returnValue($paymentMethod)); $this->requestMock->expects($this->at(1))->method('getParam')->with('controller')->will($this->returnValue($controller)); $this->quoteMock->expects($this->any())->method('getId')->will($this->returnValue($quoteId)); $this->cartManagementMock->expects($this->once())->method('placeOrder')->willThrowException(new \Exception()); $this->jsonHelperMock->expects($this->any())->method('jsonEncode')->with($result); $this->placeOrderController->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); } }