From 128d44a1a33825cc2b33504787d21f93aca307c1 Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Mon, 3 Oct 2016 20:19:40 +0530 Subject: [PATCH] Add unit test --- tests/phpunit/api/v3/ContributionTest.php | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/phpunit/api/v3/ContributionTest.php b/tests/phpunit/api/v3/ContributionTest.php index 498493607c..d3d1ca43ca 100644 --- a/tests/phpunit/api/v3/ContributionTest.php +++ b/tests/phpunit/api/v3/ContributionTest.php @@ -2593,9 +2593,36 @@ class api_v3_ContributionTest extends CiviUnitTestCase { 'Event', ) ); + + $this->checkCreditCardDetails($mut, $contribution['id']); $mut->stop(); } + /** + * Check credit card details in sent mail via API + * + * @param $mut obj CiviMailUtils instance + * @param int $contributionID Contribution ID + * + */ + public function checkCreditCardDetails($mut, $contributionID) { + $contribution = $this->callAPISuccess('contribution', 'create', $this->_params); + $this->callAPISuccess('contribution', 'sendconfirmation', array( + 'id' => $contributionID, + 'receipt_from_email' => 'api@civicrm.org', + 'payment_processor_id' => $this->paymentProcessorID, + ) + ); + $mut->checkMailLog(array( + 'Credit Card Information', // credit card header + 'Billing Name and Address', // billing header + 'anthony_anderson@civicrm.org', // billing name + ), array( + 'Event', + ) + ); + } + /** * Test sending a mail via the API. */ -- 2.25.1