Commit graph

1 commit

Author SHA1 Message Date
Frédéric FRANCE
46e48e2a82
NEW: Add phpunit tests for LoanSchedule and PaymentLoan classes (#39537)
Add CRUD tests (create/fetch/update/delete) for LoanSchedule and
PaymentLoan, which had no test coverage yet, each against a freshly
created specimen Loan. LoanScheduleTest also covers
calcMonthlyPayments() (pure amortization formula, no DB) with both
the zero-rate and standard amortization branches.

Note: PaymentLoan::create() is inconsistent with its own fetch()/
update(): it declares (and even cleans) $fk_loan and $fk_typepayment
like fetch()/update() use, but its INSERT statement actually reads
$chid and $paymenttype instead (left uncleaned). This matches the
real caller (loan/payment/payment.php), so the test sets chid/
paymenttype for create() - see class docblock in PaymentLoanTest.php.

The module is auto-activated in setUpBeforeClass() if not already
enabled, following the same pattern as the other recently added
tests (activation is real and persists after the test run, it is not
undone by the rollback in tearDownAfterClass - see comment in
setUpBeforeClass() for why).
2026-08-19 01:37:51 +02:00