Ejemplo n.º 1
0
 /**
  * Test the submit function of the membership form.
  */
 public function testSubmit()
 {
     $form = new CRM_Member_Form_Membership();
     $this->createLoggedInUser();
     $params = array('cid' => $this->_individualId, 'join_date' => date('m/d/Y', time()), 'start_date' => '', 'end_date' => '', 'membership_type_id' => array(1, 25), 'auto_renew' => '0', 'max_related' => '', 'num_terms' => '1', 'source' => '', 'total_amount' => '50.00', 'financial_type_id' => '2', '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', 'credit_card_exp_date' => array('M' => '9', 'Y' => '2019'), 'credit_card_type' => 'Visa', 'billing_first_name' => 'Test', 'billing_middlename' => 'Last', 'billing_street_address-5' => '10 Test St', 'billing_city-5' => 'Test', 'billing_state_province_id-5' => '1003', 'billing_postal_code-5' => '90210', 'billing_country_id-5' => '1228');
     $form->submit($params);
     $this->callAPISuccessGetCount('Membership', array('contact_id' => $this->_individualId), 1);
 }