Add additional test and fixes to ensure that results are the same when
authoreileen <emcnaughton@wikimedia.org>
Sat, 1 Feb 2020 22:24:36 +0000 (11:24 +1300)
committereileen <emcnaughton@wikimedia.org>
Mon, 3 Feb 2020 21:13:11 +0000 (10:13 +1300)
commit4132c927cb85d15afa236d0620f30d0f1b959872
tree239cae98410a8cb5d9f8a09e5754e5f5ada45786
parentd3e6e9a47496ff046056c589b18f0279e70264e3
Add additional test and fixes to ensure that results are the  same when

1) creating a partially paid registration with a pending contribution & then adding a payment to  that contribution
2) creating a partially paid registration with a completed contribution for a partial amount
3) created a pending registration with a pending contribution & adding a payment to the contribution.

Note that the following bugs previously affected these flows
 - flow 1 & 2 net_amount was incorrect
 - flow 1, an extraneous payment was added
 - flow 3, participant status was not updated from pending to partially paid on adding a payment
CRM/Financial/BAO/Payment.php
Civi/Test/ContactTestTrait.php
api/v3/Participant.php
tests/phpunit/CRM/Event/Form/ParticipantTest.php