-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tax fixes in unit test #20390
Tax fixes in unit test #20390
Conversation
(Standard links)
|
@@ -549,7 +558,7 @@ public function testCreateContributionChainedLineItems() { | |||
'trxn_id' => 12345, | |||
'invoice_id' => 67890, | |||
'source' => 'SSF', | |||
'contribution_status_id' => 1, | |||
'contribution_status_id' => 'Pending', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch to pending to create a valid payment flow - does not affect what is being tested (which should never be done in code - use the order api)
f3065d1
to
41723dd
Compare
@@ -2060,6 +2062,7 @@ public static function submit($params) { | |||
$paramsProcessedForForm = $form->_params = self::getFormParams($params['id'], $params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function (submit()) is used primary by unit tests via the ContributionPage.submit api. AFAIK that api is only used by a barage of tests but there might be some live usages in the ether - I would expect the test cover to be greater than any possible 'wild usage'
Reviewed code, looks good. Tested on local. |
Test fails relate @eileenmcnaughton |
265eaf8
to
8738175
Compare
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
Overview
Tax fixes in unit test
When this->isValidateFinancialsOnPostAssert is true the
test class checks that line items and payments are valid before tear down.
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)
which is invalid - removed
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
not eligible for the validation
function (accessed by tests, mostly via the ContributionPage.submit
api) - I added functionality to retrieve it
Before
Taxes affected by the above fail when we increase financial validation
After
Those tests pass
Technical Details
Some or possibly all of the failures in #20357 relate to issues with the tests
Comments