tests/phpunit - Declare `@group headless`
[civicrm-core.git] / tests / phpunit / CRM / Member / Form / MembershipTest.php
index ae19247929756799f14688ebf5aa490a718489c7..ce9291ba50a8e2c9c29974e9ccb87fce8337d0d5 100644 (file)
  * @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 {
 
@@ -98,8 +92,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
     parent::setUp();
 
     $this->_individualId = $this->individualCreate();
-    $processor = $this->processorCreate();
-    $this->_paymentProcessorID = $processor->id;
+    $this->_paymentProcessorID = $this->processorCreate();
     // Insert test data.
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute($this->_dbconn,
@@ -582,7 +575,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
    */
   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,
@@ -617,6 +610,28 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
       '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();
 
   }
 
@@ -674,6 +689,7 @@ 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' => 1,
     );
     return $params;
   }