From 309cd470a1c69b44b2d4c0651b62950a7223ddcc Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 4 Apr 2014 01:01:47 -0700 Subject: [PATCH] CRM-14423 - Call setMySQLTimeZone as part of Civi's bootstrap --- CRM/Core/Config.php | 1 + tests/phpunit/CiviTest/CiviUnitTestCase.php | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CRM/Core/Config.php b/CRM/Core/Config.php index d572964731..aa9c708eb1 100644 --- a/CRM/Core/Config.php +++ b/CRM/Core/Config.php @@ -257,6 +257,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { array(1 => array($userID, 'Integer')) ); } + self::$_singleton->userSystem->setMySQLTimeZone(); // initialize authentication source self::$_singleton->initAuthSrc(); diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index cd8d3dd560..29858af64d 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -306,9 +306,6 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { // also set this global hack $GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'] = array(); - - $env = new CRM_Utils_Check_Env(); - CRM_Utils_Check::singleton()->assertValid($env->checkAll()); } /** @@ -353,6 +350,11 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { // reset all the caches CRM_Utils_System::flushCache(); + // Make sure the DB connection is setup properly + $config->userSystem->setMySQLTimeZone(); + $env = new CRM_Utils_Check_Env(); + CRM_Utils_Check::singleton()->assertValid($env->checkAll()); + // clear permissions stub to not check permissions $config = CRM_Core_Config::singleton(); $config->userPermissionClass->permissions = NULL; -- 2.25.1