/** * @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 testGetSetState() { $payment = new Payment($this->getInstruction(), 123); $this->assertSame(Payment::STATE_NEW, $payment->getState()); $payment->setState(Payment::STATE_APPROVED); $this->assertSame(Payment::STATE_APPROVED, $payment->getState()); }