From 748bcfb2ff867ce26eacddf4ebf34ed428815383 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Tue, 12 Jul 2016 02:56:07 +0000 Subject: [PATCH] Add test of Supports Financial Type Change in Contribution Recur --- .../Contribute/BAO/ContributionRecurTest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php b/tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php index de49105d76..a2259b9500 100644 --- a/tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php +++ b/tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php @@ -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'])); + } + } -- 2.25.1