Commit graph

1 commit

Author SHA1 Message Date
Frédéric FRANCE
b402a4c3af
NEW: Add phpunit test for PaymentVAT class (#39544)
Add a test for PaymentVAT, which had no test coverage yet.

PaymentVAT is the class actually used by the core UI
(compta/tva/card.php, compta/paiement_vat.php) to record a payment
against a Tva declaration - unlike Tva::addPayment(), which is
legacy/unused (see TvaTest.php). PaymentVAT::create() and
Tva::getSommePaiement() do agree on the same table/link
(payment_vat.fk_tva), so paying a declaration in full with
closepaidvat=1 and checking it comes back paid is a genuine
regression check.

Note: like PaymentLoan (see PaymentLoanTest.php), PaymentVAT::create()
does not use the $fk_tva/$fk_typepaiement properties it cleans at the
top of the method: its INSERT actually reads $chid and $paiementtype
(both left uncleaned), matching the real callers - see class docblock.

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-15 18:21:48 +02:00