From: Tim Otten Date: Thu, 26 Feb 2015 02:11:45 +0000 (-0700) Subject: CRM-14423 - CiviUnitTestCase - UnitTest UF should set MySQL TZ (like Drupal/WP) X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=266848212cd9bab5d1e9adc05aa98d0239b69d59;p=civicrm-core.git CRM-14423 - CiviUnitTestCase - UnitTest UF should set MySQL TZ (like Drupal/WP) --- 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;