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

CRM-19964 Event registration creates contribution without line item #9774

Merged
merged 5 commits into from
Feb 14, 2017

Conversation

pradpnayak
Copy link
Contributor

@pradpnayak pradpnayak commented Feb 3, 2017

@seamuslee001
Copy link
Contributor

Jenkins test this please

@Edzelopez
Copy link
Contributor

@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?

@eileenmcnaughton
Copy link
Contributor

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
@Edzelopez
Copy link
Contributor

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);
Copy link
Contributor

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?

@eileenmcnaughton
Copy link
Contributor

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.

@eileenmcnaughton eileenmcnaughton merged commit b5ca366 into civicrm:master Feb 14, 2017
@pradpnayak pradpnayak deleted the CRM-19964 branch February 22, 2017 10:56
monishdeb pushed a commit to monishdeb/civicrm-core that referenced this pull request May 2, 2017
CRM-19964 Event registration creates contribution without line item
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.

5 participants