public function testAcceptWithoutInvoiceResultTrue() { $baseGrandTotal = null; $acceptPayment = true; $this->payment->setData('transaction_id', $this->transactionId); $this->invoiceMock->expects($this->never())->method('pay'); $this->orderMock->expects($this->any())->method('getInvoiceCollection')->willReturn([]); $this->helperMock->expects($this->once())->method('getMethodInstance')->will($this->returnValue($this->paymentMethodMock)); $this->paymentMethodMock->expects($this->once())->method('setStore')->will($this->returnSelf()); $this->paymentMethodMock->expects($this->once())->method('acceptPayment')->with($this->payment)->willReturn($acceptPayment); $status = 'status'; $this->mockGetDefaultStatus(Order::STATE_PROCESSING, $status); $this->assertOrderUpdated(Order::STATE_PROCESSING, $status, __('Approved the payment online.')); $this->payment->accept(); $this->assertEquals($baseGrandTotal, $this->payment->getBaseAmountPaidOnline()); }
/** * {@inheritdoc} */ public function accept() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'accept'); if (!$pluginInfo) { return parent::accept(); } else { return $this->___callPlugins('accept', func_get_args(), $pluginInfo); } }