From 337be0d2da7c296691caf1cd0666be137b040ef7 Mon Sep 17 00:00:00 2001 From: Jitendra Purohit Date: Wed, 13 Sep 2017 17:40:42 +0530 Subject: [PATCH] add unit test --- tests/phpunit/api/v3/ContributionPageTest.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/phpunit/api/v3/ContributionPageTest.php b/tests/phpunit/api/v3/ContributionPageTest.php index 13d56d020d..ea7e3428e0 100644 --- a/tests/phpunit/api/v3/ContributionPageTest.php +++ b/tests/phpunit/api/v3/ContributionPageTest.php @@ -434,6 +434,34 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase { $mut->clearMessages(); } + /** + * Test submit with a pay later abnd check line item in mails. + */ + public function testSubmitMembershipBlockIsSeparatePaymentPayLaterWithEmail() { + $mut = new CiviMailUtils($this, TRUE); + $this->setUpMembershipContributionPage(); + $submitParams = array( + 'price_' . $this->_ids['price_field'][0] => reset($this->_ids['price_field_value']), + 'id' => (int) $this->_ids['contribution_page'], + 'amount' => 10, + 'billing_first_name' => 'Billy', + 'billing_middle_name' => 'Goat', + 'billing_last_name' => 'Gruff', + 'is_pay_later' => 1, + 'selectMembership' => $this->_ids['membership_type'], + 'email-Primary' => 'billy-goat@the-bridge.net', + ); + + $this->callAPISuccess('contribution_page', 'submit', $submitParams); + $contribution = $this->callAPISuccess('contribution', 'getsingle', array('contribution_page_id' => $this->_ids['contribution_page'])); + $this->callAPISuccess('membership_payment', 'getsingle', array('contribution_id' => $contribution['id'])); + $mut->checkMailLog(array( + 'Membership Amount -... $ 2.00', + )); + $mut->stop(); + $mut->clearMessages(); + } + /** * Test submit with a membership block in place. */ -- 2.25.1