Skip to content
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

Fix CRM/Event/BAO/AdditionalPaymentTest.php to use Order.create #15813

Merged
merged 1 commit into from
Nov 15, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

This test wasn't really testing much since the functions were kinda contorted into doing what the
test was testing. I've updated it to do set up using Order.create & not to use the 'partial_amount_to_pay'
keys which turn out not to create valid transactions (& which we want to fully remove from the other places).

I had to co-erce tax_amount into a float in a couple of places & shortened a param for readability.

I commented out a couple of checks that only worked because of unrealisitic function calls
I added https://lab.civicrm.org/dev/financial/issues/102 to track that.

Overview

A brief description of the pull request. Try to keep it non-technical.

Before

The current status. Please provide screenshots or gifs (LICEcap, SilentCast) where appropriate.

After

What has been changed. Please provide screenshots or gifs (LICEcap, SilentCast) where appropriate.

Technical Details

If the PR introduces noteworthy technical changes, please describe them here. Provide code snippets if necessary

Comments

Anything else you would like the reviewer to note

@civibot
Copy link

civibot bot commented Nov 11, 2019

(Standard links)

@civibot civibot bot added the master label Nov 11, 2019
@eileenmcnaughton eileenmcnaughton force-pushed the fee branch 3 times, most recently from c22441c to 9156d03 Compare November 11, 2019 20:38
This test wasn't really testing much since the functions were kinda contorted into doing what the
test was testing. I've updated it to do set up using Order.create & not to use the 'partial_amount_to_pay'
keys which turn out not to create valid transactions (& which we want to fully remove from the other places).

I had to co-erce tax_amount into a float in a couple of places & shortened a param for readability.

I commented out a couple of checks that only worked because of unrealisitic function calls
I added https://lab.civicrm.org/dev/financial/issues/102 to track that.
if ($previousLineItems[$updateFinancialItemInfoValues['entity_id']]['tax_amount']) {
$updateFinancialItemInfoValues['tax']['amount'] = $lineItemsToUpdate[$updateFinancialItemInfoValues['entity_id']]['tax_amount'] - $previousLineItems[$updateFinancialItemInfoValues['entity_id']]['tax_amount'];
if ($previousLineItem['tax_amount']
&& $previousLineItems[$updateFinancialItemInfoValues['entity_id']]['tax_amount'] !== 0.00) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eileenmcnaughton Do these 0.00 comparisons work? As a float the value would be 0.0, as a string it could be "0.00"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added them because the tests failed without them - it's casting to float now

@mattwire mattwire merged commit 817280e into civicrm:master Nov 15, 2019
@eileenmcnaughton eileenmcnaughton deleted the fee branch November 15, 2019 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants