From 266848212cd9bab5d1e9adc05aa98d0239b69d59 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 25 Feb 2015 19:11:45 -0700 Subject: [PATCH] CRM-14423 - CiviUnitTestCase - UnitTest UF should set MySQL TZ (like Drupal/WP) --- tests/phpunit/CiviTest/CiviUnitTestCase.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 382d231058..35402a16a7 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -316,9 +316,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->checkMysqlTime()); } /** @@ -366,6 +363,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->checkMysqlTime()); + // clear permissions stub to not check permissions $config = CRM_Core_Config::singleton(); $config->userPermissionClass->permissions = NULL; -- 2.25.1