Tax fixes in unit test
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 24 May 2021 01:48:24 +0000 (13:48 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 24 May 2021 20:08:45 +0000 (08:08 +1200)
commitd6c86ce5c22e76a79596a6af0b930a3b91c33537
tree2d6a8c3eab4d2bbd50d6faaaea3b77ea3d508df5
parentfcf34143f560c33de8741eaf6459ef9d620fd7be
Tax fixes in unit test

When this->isValidateFinancialsOnPostAssert is true the
test class checks that line items and payments are valid.

I'm trying to enable this for this class. However, there are some issues
that I have found fixes for (and at least 1 I'm still working on)
- some tests try to set tax_amount when it is not enabled
which is invalid - removed
- one test tries to use chaining in a way that
we know is not going to do a job of creating the entities
as it adds the payment before the line items. I switched
this to create a pending payment which doesn't alter the
thing under test & brings it closer to the
recommended flow
- one test is deliberately invalid - I marked it as
not eligible for the validation
- the price set id was not being passed to the Confirm->submit
function (accessed by tests, mostly via the ContributionPage.submit
api) - I added functionality to retrieve it
CRM/Contribute/Form/Contribution/Confirm.php
CRM/Financial/BAO/Order.php
tests/phpunit/CRM/Contribute/Form/ContributionTest.php
tests/phpunit/api/v3/ContributionPageTest.php
tests/phpunit/api/v3/ContributionTest.php