From: Eileen McNaughton Date: Tue, 12 Apr 2016 14:15:35 +0000 (+1200) Subject: CRM-18303 follow up - add test for membership form (#8120) X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=bbaa79ff31f1380cafc8e46884e699ba7b1f3ac2;p=civicrm-core.git CRM-18303 follow up - add test for membership form (#8120) --- diff --git a/tests/phpunit/CRM/Member/Form/MembershipTest.php b/tests/phpunit/CRM/Member/Form/MembershipTest.php index 176377a1f6..f3bc8d4f2f 100644 --- a/tests/phpunit/CRM/Member/Form/MembershipTest.php +++ b/tests/phpunit/CRM/Member/Form/MembershipTest.php @@ -81,6 +81,11 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { */ protected $paymentInstruments = array(); + /** + * @var CiviMailUtils + */ + protected $mut; + /** * Test setup for every test. * @@ -426,6 +431,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { */ public function testSubmit() { $form = $this->getForm(); + $this->mut = new CiviMailUtils($this, TRUE); $form->_mode = 'test'; $this->createLoggedInUser(); $params = array( @@ -444,7 +450,6 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { 'soft_credit_type_id' => '', 'soft_credit_contact_id' => '', 'from_email_address' => '"Demonstrators Anonymous" ', - 'receipt_text_signup' => 'Thank you text', 'payment_processor_id' => $this->_paymentProcessorID, 'credit_card_number' => '4111111111111111', 'cvv2' => '123', @@ -460,6 +465,8 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { 'billing_state_province_id-5' => '1003', 'billing_postal_code-5' => '90210', 'billing_country_id-5' => '1228', + 'send_receipt' => TRUE, + 'receipt_text' => 'Receipt text', ); $form->_contactID = $this->_individualId; $form->testSubmit($params); @@ -475,6 +482,11 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { 'entity_table' => 'civicrm_membership', 'contribution_id' => $contribution['id'], ), 1); + $this->mut->checkMailLog(array( + '50', + 'Receipt text', + )); + $this->mut->stop(); } /**