/** * Testing adding amount to PayPal refunded amount */ public function testAddRefundedAmount_NotEmpty() { $oOrderPayment = new oePayPalOrderPayment(); $oOrderPayment->setRefundedAmount(100); $oOrderPayment->addRefundedAmount(100); $this->assertEquals(200, $oOrderPayment->getRefundedAmount()); }
/** * Tests isPayPalActionValid * * @dataProvider isActionValid_dataProvider */ public function testIsActionAvailable($sPayment, $dAmount, $dRefunded, $sState, $sAction, $dIsValid) { $oPayment = new oePayPalOrderPayment(); $oPayment->setAction($sPayment); $oPayment->setAmount($dAmount); $oPayment->setRefundedAmount($dRefunded); $oPayment->setStatus($sState); $oActionManager = new oePayPalOrderPaymentActionManager(); $oActionManager->setPayment($oPayment); $this->assertEquals($dIsValid, $oActionManager->isActionAvailable($sAction)); }