test fixes
authoreileenmcnaughton <eileen@fuzion.co.nz>
Fri, 11 Sep 2015 01:46:48 +0000 (01:46 +0000)
committereileenmcnaughton <eileen@fuzion.co.nz>
Fri, 11 Sep 2015 01:46:48 +0000 (01:46 +0000)
CRM/Financial/BAO/PaymentProcessor.php
Civi/Payment/System.php

index 19bcbb87e0f982dda73551b8eccc89ccf8b83288..e79722e603f24adf25a878c0a124e9d3fa5c1f87 100644 (file)
@@ -267,9 +267,9 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces
    * @throws CiviCRM_API3_Exception
    * @return array
    */
-  public static function getAllPaymentProcessors($mode, $reset = FALSE) {
+  public static function getAllPaymentProcessors($mode = 'all', $reset = FALSE) {
 
-    $cacheKey = 'CRM_Financial_BAO_Payment_Processor_' . ($mode ? 'test' : 'all') . '_' . CRM_Core_Config::domainID();
+    $cacheKey = 'CRM_Financial_BAO_Payment_Processor_' . $mode . '_' . CRM_Core_Config::domainID();
     if (!$reset) {
       $processors = CRM_Utils_Cache::singleton()->get($cacheKey);
       if (!empty($processors)) {
@@ -328,7 +328,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces
   public static function getPaymentProcessors($capabilities = array(), $ids = FALSE) {
     $mode = NULL;
     $testProcessors = in_array('TestMode', $capabilities) ? self::getAllPaymentProcessors('test') : array();
-    $processors = $liveProcessors = self::getAllPaymentProcessors('live');
+    $processors = $liveProcessors = self::getAllPaymentProcessors('all');
 
     if (in_array('TestMode', $capabilities)) {
       if ($ids) {
index 253784f2d7199988d6f907a23c0694eeda633450..5bfa71b2a0e4152ac1387d24000300141324bcaf 100644 (file)
@@ -99,11 +99,11 @@ class System {
    * Flush processors from static cache.
    *
    * This is particularly used for tests.
-   *
    */
   public function flushProcessors() {
     $this->cache = array();
-    \CRM_Financial_BAO_PaymentProcessor::getAllPaymentProcessors(NULL, TRUE);
+    \CRM_Financial_BAO_PaymentProcessor::getAllPaymentProcessors('all', TRUE);
+    \CRM_Financial_BAO_PaymentProcessor::getAllPaymentProcessors('live', TRUE);
     \CRM_Financial_BAO_PaymentProcessor::getAllPaymentProcessors('test', TRUE);
   }