-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
CRM-19964 Event registration creates contribution without line item #9774
Conversation
pradpnayak
commented
Feb 3, 2017
•
edited by civicrm-builder
Loading
edited by civicrm-builder
- CRM-19964: Event registration creates contribution without line item
Jenkins test this please |
@eileenmcnaughton I tried creating a unit test for this, but it seems like there isn't a way to emulate a form submission for an online registration similar to the "$form->testSubmit" we use for contribution pages. I also can't find examples of online registration test cases under tests/phpunit/api/v3/. Hasn't a helper function been created yet or is there another way I should be doing this? |
Hey @Edzelopez that's the sort of question I like :-) I only added the first Event form test recently - look for this class CRM_Event_Form_Registration_ConfirmTest |
---------------------------------------- * CRM-19964: Event registration creates contribution without line item https://issues.civicrm.org/jira/browse/CRM-19964
---------------------------------------- * CRM-19964: Event registration creates contribution without line item https://issues.civicrm.org/jira/browse/CRM-19964
…ecord contribution is checked ---------------------------------------- * CRM-19964: Event registration creates contribution without line item https://issues.civicrm.org/jira/browse/CRM-19964
---------------------------------------- * CRM-19964: Event registration creates contribution without line item https://issues.civicrm.org/jira/browse/CRM-19964
Added unit test |
---------------------------------------- * CRM-19964: Event registration creates contribution without line item https://issues.civicrm.org/jira/browse/CRM-19964
@@ -1015,6 +1015,7 @@ public function postProcess() { | |||
else { | |||
$submittedLineItems = array($lineItem); | |||
} | |||
$submittedLineItems = array_filter($submittedLineItems); |
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.
what is the reason for this?
I'm going to merge this - the use of array_filter feels like hack to get around another problem. OTOH it is locked in with a unit test & fixes an important bug. |
CRM-19964 Event registration creates contribution without line item