/** * @dataProvider getTestAmountsForDependentCredit * @expectedException \InvalidArgumentException */ public function testCreditOnlyAcceptsValidAmountsForDependentCredit($amount) { $controller = $this->getController(); $instruction = new PaymentInstruction(111, 'EUR', 'foo', new ExtendedData()); $instruction->setState(PaymentInstruction::STATE_VALID); $credit = new Credit($instruction, 100); $payment = new Payment($instruction, 10); $payment->setState(Payment::STATE_APPROVED); $credit->setPayment($payment); $instruction->setDepositedAmount(10); $payment->setDepositedAmount(5.0); $payment->setCreditingAmount(0.01); $payment->setCreditedAmount(0.01); $payment->setReversingDepositedAmount(0.01); $this->callCredit($controller, array($credit, $amount)); }
public function testSetGetPayment() { $credit = new Credit($instruction = $this->getInstruction(), 11); $this->assertNull($credit->getPayment()); $credit->setPayment($payment = new Payment($instruction, 100)); $this->assertSame($payment, $credit->getPayment()); }