+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015 |
+ | Copyright CiviCRM LLC (c) 2004-2016 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
* @author Walt Haas <walt@dharmatech.org> (801) 534-1262
*/
-/**
- * Include class definitions
- */
-require_once 'CiviTest/CiviUnitTestCase.php';
-
-require_once 'HTML/QuickForm/Page.php';
-
/**
* Test CRM_Member_Form_Membership functions.
*
* @package CiviCRM
+ * @group headless
*/
class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
*/
protected $paymentInstruments = array();
+ /**
+ * @var CiviMailUtils
+ */
+ protected $mut;
+
/**
* Test setup for every test.
*
*/
public function testSubmit() {
$form = $this->getForm();
+ $this->mut = new CiviMailUtils($this, TRUE);
$form->_mode = 'test';
$this->createLoggedInUser();
$params = array(
'soft_credit_type_id' => '',
'soft_credit_contact_id' => '',
'from_email_address' => '"Demonstrators Anonymous" <info@example.org>',
- 'receipt_text_signup' => 'Thank you text',
'payment_processor_id' => $this->_paymentProcessorID,
'credit_card_number' => '4111111111111111',
'cvv2' => '123',
'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);
'entity_table' => 'civicrm_membership',
'contribution_id' => $contribution['id'],
), 1);
+ $this->mut->checkMailLog(array(
+ '50',
+ 'Receipt text',
+ ));
+ $this->mut->stop();
}
/**
*/
public function testSubmitRecurCompleteInstant() {
$form = $this->getForm();
-
+ $mut = new CiviMailUtils($this, TRUE);
$processor = Civi\Payment\System::singleton()->getById($this->_paymentProcessorID);
$processor->setDoDirectPaymentResult(array(
'payment_status_id' => 1,
'entity_table' => 'civicrm_membership',
'contribution_id' => $contribution['id'],
), 1);
+ $mut->checkMailLog(array(
+ '===========================================================
+Billing Name and Address
+===========================================================
+Test
+10 Test St
+Test, AR 90210
+US',
+ '===========================================================
+Membership Information
+===========================================================
+Membership Type: AnnualFixed
+Membership Start Date: ',
+ '===========================================================
+Credit Card Information
+===========================================================
+Visa
+************1111
+Expires: ',
+ )
+ );
+ $mut->stop();
}
'billing_state_province_id-5' => '1003',
'billing_postal_code-5' => '90210',
'billing_country_id-5' => '1228',
+ 'send_receipt' => 1,
);
return $params;
}