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-19658 test for is_email_receipt override #9403

Merged
merged 2 commits into from
Nov 19, 2016
Merged

CRM-19658 test for is_email_receipt override #9403

merged 2 commits into from
Nov 19, 2016

Conversation

KarinG
Copy link
Contributor

@KarinG KarinG commented Nov 16, 2016

@KarinG
Copy link
Contributor Author

KarinG commented Nov 16, 2016

Orginal JIRA ticket: https://issues.civicrm.org/jira/browse/CRM-19601
JIRA ticket for the test: https://issues.civicrm.org/jira/browse/CRM-19658

@KarinG
Copy link
Contributor Author

KarinG commented Nov 16, 2016

Jenkins test please

@KarinG
Copy link
Contributor Author

KarinG commented Nov 16, 2016

Jenkins test this please!

@KarinG
Copy link
Contributor Author

KarinG commented Nov 16, 2016

@KarinG
Copy link
Contributor Author

KarinG commented Nov 17, 2016

Ok - so the test is 'correctly' failing -> as that's why we need #9353

@eileenmcnaughton eileenmcnaughton changed the title Test for https://github.com/civicrm/civicrm-core/pull/9353 CRM-19658 test for is_email_receipt override Nov 19, 2016
@eileenmcnaughton
Copy link
Contributor

test this please

@eileenmcnaughton
Copy link
Contributor

I've just copied the above test to demonstrate how to test no email actually goes out - that would be a valuable addition here

  /**
   * Test the submit function on the contribution page.
   */
  public function testSubmitEmailReceipt() {
    $form = new CRM_Contribute_Form_Contribution();
    $mut = new CiviMailUtils($this, TRUE);
    $form->testSubmit(array(
      'total_amount' => 50,
      'financial_type_id' => 1,
      'receive_date' => '04/21/2015',
      'receive_date_time' => '11:27PM',
      'contact_id' => $this->_individualId,
      'is_email_receipt' => TRUE,
      'from_email_address' => 'test@test.com',
      'contribution_status_id' => 1,
    ), CRM_Core_Action::ADD);
    $this->callAPISuccessGetCount('Contribution', array('contact_id' => $this->_individualId), 1);
    $mut->checkMailLog(array(
        '<p>Please print this receipt for your records.</p>',
      )
    );
    $mut->stop();
  }

@eileenmcnaughton eileenmcnaughton merged commit 5e86614 into civicrm:master Nov 19, 2016
@KarinG
Copy link
Contributor Author

KarinG commented Nov 21, 2016

@eileenmcnaughton - What if that message/text '

Please print this receipt for your records.

' changes? It would make this test fail. I decided to go with a test to check if a receipt_date is recorded. But of course that also contains assumptions.

@eileenmcnaughton
Copy link
Contributor

@KarinG yep - it does cause the test to fail & people have to fix it - but I think that level of brittleness is ok because if it is a real result of a change the person will be able to identify easily.

NB you don't have to take this further - I did merge it - but maybe someone preparing for gsoc will

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants