From 3a1f9fd3420df0ba639d4b47ccd4fa8e0221781a Mon Sep 17 00:00:00 2001 From: eileenmcnaugton Date: Thu, 27 Aug 2015 10:54:12 +1200 Subject: [PATCH] CRM-17092 add test to ensure contribution_recur_id is being set' --- CRM/Core/Payment/Dummy.php | 4 +++- tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Payment/Dummy.php b/CRM/Core/Payment/Dummy.php index f4e54d6c45..7a40da5f79 100644 --- a/CRM/Core/Payment/Dummy.php +++ b/CRM/Core/Payment/Dummy.php @@ -80,7 +80,9 @@ class CRM_Core_Payment_Dummy extends CRM_Core_Payment { // the back-end's canonical set of parameters. But if a processor // does this, it needs to invoke this hook after it has done translation, // but before it actually starts talking to its proprietary back-end. - + if (!empty($params['is_recur'])) { + $throwAnENoticeIfNotSetAsTheseAreRequired = $params['frequency_interval'] . $params['frequency_unit']; + } // no translation in Dummy processor $cookedParams = $params; CRM_Utils_Hook::alterPaymentProcessorParams($this, diff --git a/tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php b/tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php index fb95bda61d..ca7b17a571 100644 --- a/tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php +++ b/tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php @@ -308,7 +308,8 @@ class CRM_Member_Form_MembershipRenewalTest extends CiviUnitTestCase { $form->testSubmit($params); $membership = $this->callAPISuccessGetSingle('Membership', array('contact_id' => $this->_individualId)); - $this->callAPISuccessGetCount('ContributionRecur', array('contact_id' => $this->_individualId), 1); + $contributionRecur = $this->callAPISuccessGetSingle('ContributionRecur', array('contact_id' => $this->_individualId)); + $this->assertEquals($contributionRecur['id'], $membership['contribution_recur_id']); $contribution = $this->callAPISuccess('Contribution', 'getsingle', array( 'contact_id' => $this->_individualId, @@ -327,6 +328,7 @@ class CRM_Member_Form_MembershipRenewalTest extends CiviUnitTestCase { ), 1); } + /** * Test the submit function of the membership form. */ -- 2.25.1