/** * @dataProvider getTestAmountsForDependentCreditOnRetry * @expectedException \InvalidArgumentException */ public function testCreditOnlyAcceptsValidAmountsForDependentCreditOnRetry($amount) { $controller = $this->getController(); $instruction = new PaymentInstruction(111, 'EUR', 'foo', new ExtendedData()); $instruction->setState(PaymentInstruction::STATE_VALID); $credit = new Credit($instruction, 100); $credit->setState(CreditInterface::STATE_CREDITING); $payment = new Payment($instruction, 10); $payment->setState(Payment::STATE_APPROVED); $credit->setPayment($payment); $credit->setCreditingAmount(7.12); $instruction->setDepositedAmount(10); $payment->setDepositedAmount(5.0); $payment->setCreditingAmount(0.01); $payment->setCreditedAmount(0.01); $payment->setReversingDepositedAmount(0.01); $transaction = new FinancialTransaction(); $transaction->setTransactionType(FinancialTransaction::TRANSACTION_TYPE_CREDIT); $transaction->setState(FinancialTransaction::STATE_PENDING); $credit->addTransaction($transaction); $this->callCredit($controller, array($credit, $amount)); }