Add test for receipt output (test written to pre-change output)
authoreileen <emcnaughton@wikimedia.org>
Wed, 20 Feb 2019 12:05:17 +0000 (01:05 +1300)
committereileen <emcnaughton@wikimedia.org>
Fri, 22 Feb 2019 00:21:33 +0000 (13:21 +1300)
tests/phpunit/CRM/Contribute/Form/AdditionalPaymentTest.php

index 0557dc3881e93fa92394c034e2fe600e2e89c6c7..2f92aa64cd3d9854594d803aeaae4e4c4143d643 100644 (file)
@@ -183,16 +183,28 @@ class CRM_Contribute_Form_AdditionalPaymentTest extends CiviUnitTestCase {
    * Test the submit function that completes the partially paid Contribution with multiple payments.
    */
   public function testMultiplePaymentForPartiallyPaidContributionWithOneCreditCardPayment() {
+    $mut = new CiviMailUtils($this, TRUE);
     $this->createContribution('Partially paid');
 
     // pay additional amount
-    $this->submitPayment(50);
+    $this->submitPayment(50, NULL, TRUE);
     $contribution = $this->callAPISuccessGetSingle('Contribution', array('id' => $this->_contributionId));
     $this->assertEquals('Partially paid', $contribution['contribution_status']);
 
     // pay additional amount by using credit card
     $this->submitPayment(20, 'live');
     $this->checkResults(array(30, 50, 20), 3);
+    $mut->assertSubjects(array('Payment Receipt -'));
+    $mut->checkMailLog(array(
+      'Dear Anthony Anderson',
+      'A payment has been received',
+      'Total Fees: $ 100.00',
+      'This Payment Amount: $ 50.00',
+      'Balance Owed: $ 20.00 ',
+      'Paid By: Check',
+      'Check Number: check-12345',
+    ));
+    $mut->stop();
   }
 
   /**