_ids['payment_processor'] = $this->paymentProcessorCreate(); $this->_params = array( 'contact_id' => $this->individualCreate(), 'amount' => 3.00, 'frequency_unit' => 'week', 'frequency_interval' => 1, 'installments' => 2, 'start_date' => 'yesterday', 'create_date' => 'yesterday', 'modified_date' => 'yesterday', 'cancel_date' => NULL, 'end_date' => '+ 2 weeks', 'processor_id' => '643411460836', 'trxn_id' => 'e0d0808e26f3e661c6c18eb7c039d363', 'invoice_id' => 'e0d0808e26f3e661c6c18eb7c039d363', 'contribution_status_id' => 1, 'is_test' => 0, 'cycle_day' => 1, 'next_sched_contribution_date' => '+ 1 week', 'failure_count' => 0, 'failure_retry_date' => NULL, 'auto_renew' => 0, 'currency' => 'USD', 'payment_processor_id' => $this->_ids['payment_processor'], 'is_email_receipt' => 1, 'financial_type_id' => 1, 'payment_instrument_id' => 1, 'campaign_id' => NULL, ); } public function teardown() { $this->quickCleanup(array('civicrm_contribution_recur', 'civicrm_payment_processor')); } /** * Test that an object can be retrieved & saved (per CRM-14986) * this has been causing a DB error so we are checking for absence of error */ public function testFindSave() { $contributionRecur = $this->callAPISuccess('contribution_recur', 'create', $this->_params); $dao = new CRM_Contribute_BAO_ContributionRecur(); $dao->id = $contributionRecur['id']; $dao->find(TRUE); $dao->is_email_receipt = 0; $dao->save(); } /** * Test cancellation works per CRM-14986 * we are checking for absence of error */ public function testCancelRecur() { $contributionRecur = $this->callAPISuccess('contribution_recur', 'create', $this->_params); CRM_Contribute_BAO_ContributionRecur::cancelRecurContribution($contributionRecur['id'], CRM_Core_DAO::$_nullObject); } }