From b04bcc45f979b729ff5e1e2c2ce18f0c7a40501a Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 5 Apr 2019 13:40:11 +1300 Subject: [PATCH] Flush ContributionRecur static cache when flushing processors When creating a processor in a unit test it may not be available to use when creating a recurring in the same test without flushing the static cache here --- Civi/Payment/System.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Civi/Payment/System.php b/Civi/Payment/System.php index ed207143ad..536ed52048 100644 --- a/Civi/Payment/System.php +++ b/Civi/Payment/System.php @@ -134,6 +134,9 @@ class System { */ public function flushProcessors() { $this->cache = []; + if (isset(\Civi::$statics['CRM_Contribute_BAO_ContributionRecur'])) { + unset(\Civi::$statics['CRM_Contribute_BAO_ContributionRecur']); + } \CRM_Financial_BAO_PaymentProcessor::getAllPaymentProcessors('all', TRUE); \CRM_Financial_BAO_PaymentProcessor::getAllPaymentProcessors('live', TRUE); \CRM_Financial_BAO_PaymentProcessor::getAllPaymentProcessors('test', TRUE); -- 2.25.1