Add test of Supports Financial Type Change in Contribution Recur
authorSeamus Lee <seamuslee001@gmail.com>
Tue, 12 Jul 2016 02:56:07 +0000 (02:56 +0000)
committerSeamus Lee <seamuslee001@gmail.com>
Tue, 12 Jul 2016 03:30:04 +0000 (03:30 +0000)
tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php

index de49105d76d2bc54e6607113bf8d66ec219293f4..a2259b9500d49f33706d55bb1753d0e8446877b8 100644 (file)
@@ -93,4 +93,23 @@ class CRM_Contribute_BAO_ContributionRecurTest extends CiviUnitTestCase {
     CRM_Contribute_BAO_ContributionRecur::cancelRecurContribution($contributionRecur['id'], CRM_Core_DAO::$_nullObject);
   }
 
+  /**
+   * Test checking if contribution recurr object can allow for changes to financial types.
+   *
+   */
+  public function testSupportFinancialTypeChange() {
+    $contributionRecur = $this->callAPISuccess('contribution_recur', 'create', $this->_params);
+    $contribution = $this->callAPISuccess('contribution', 'create', array(
+      'contribution_recur_id' => $contributionRecur['id'],
+      'total_amount' => '3.00',
+      'financial_type_id' => 1,
+      'payment_instrument_id' => 1,
+      'currency' => 'USD',
+      'contact_id' => $this->individualCreate(),
+      'contribution_status_id' => 1,
+      'recieve_date' => 'yesterday',
+    ));
+    $this->assertTrue(CRM_Contribute_BAO_ContributionRecur::supportsFinancialTypeChange($contributionRecur['id']));
+  }
+
 }