From 40406b562fff2686d65bf7b837b501c65c2ff3a6 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sun, 12 Mar 2017 21:45:00 -0700 Subject: [PATCH] Civi\API\ExternalBatch - Improve test for variables_order/$_ENV The recent revision #9595 updated `ExternalBatch` to produce a more informative error message. However, in the test environment used by `flexmailer`, there was exactly 1 value in `$_ENV` (even if `variables_order` was misconfigured). This should make the test a bit harder to trip-up by affirmatively checking for the most common environment variable. Review note: In the known universe, the only direct references to `ExternalBatch` are in `CiviUnitTestCase`, so this shouldn't impact any runtime logic. --- Civi/API/ExternalBatch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Civi/API/ExternalBatch.php b/Civi/API/ExternalBatch.php index 5e48a4a3f8..6a8d463e14 100644 --- a/Civi/API/ExternalBatch.php +++ b/Civi/API/ExternalBatch.php @@ -52,7 +52,7 @@ class ExternalBatch { $this->settingsPath = defined('CIVICRM_SETTINGS_PATH') ? CIVICRM_SETTINGS_PATH : NULL; $this->defaultParams = $defaultParams; $this->env = $_ENV; - if (empty($_ENV)) { + if (empty($_ENV['PATH'])) { // FIXME: If we upgrade to newer Symfony\Process and use the newer // inheritEnv feature, then this becomes unnecessary. throw new \CRM_Core_Exception('ExternalBatch cannot detect environment: $_ENV is missing. (Tip: Set variables_order=EGPCS in php.ini.)'); -- 2.25.1