-
-
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
FinancialTrxnTest - Fix unit test to be 'legit' #15799
Conversation
(Standard links)
|
e1a863e
to
dc36775
Compare
@@ -141,40 +148,29 @@ public function testCreateDeferredTrxn() { | |||
'receive_date' => '2016-01-20', | |||
'total_amount' => 622, | |||
'financial_type_id' => 4, | |||
'line_items' => [ |
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.
These are for $100 but cont total is 622 = invalid data
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.
LOL
$total = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $params['contribution_id'], 'total_amount'); | ||
$cmp = bccomp($total, $paid, 5); | ||
// If paid amount is greater or equal to total amount | ||
if ($cmp == 0 || $cmp == -1) { |
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.
never true - never hit
dc36775
to
5ea38b9
Compare
This unit test is one of a bunch that came up as not creating valid payments. The issue is in the test set up methodology (the 'partial_payment_to_pay' key doesn't work). On tidying up the test proved to be mostly cruft from an earlier iteration
5ea38b9
to
f150189
Compare
@seamuslee001 test-only PR |
Looks good to me |
Overview
Cleans up a flawed unit test - identified in #15706
Before
Test setup results in incorrect payments created
After
Setup correct. Unhit lines of test removed.
Technical Details
This unit test is one of a bunch that came up as not creating valid payments. The issue is
in the test set up methodology (the 'partial_payment_to_pay' key doesn't work).
On tidying up the test proved to be mostly cruft from an earlier iteration
Comments