From f80b75a6aad9e6ef5bec4328bf5f99e8dfbc11ef Mon Sep 17 00:00:00 2001 From: Platonides Date: Fri, 29 Apr 2011 16:26:20 +0000 Subject: [PATCH] The $wgLocalisationCacheConf was being overwritten by the default value. Restores the ability to run databaseless tests broken by r86775 --- tests/phpunit/MediaWikiTestCase.php | 2 +- tests/phpunit/phpunit.php | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 8e3d215486..0bf04aa0cb 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -35,7 +35,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * Replace with a HashBag. They would not be going to persist anyway. */ ObjectCache::$instances[CACHE_DB] = new HashBagOStuff; - + if( $this->needsDB() ) { global $wgDBprefix; diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index e9381eb782..7acc79ca12 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -22,11 +22,18 @@ class PHPUnitMaintClass extends Maintenance { parent::finalSetup(); global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgUseDatabaseMessages; + global $wgLocaltimezone, $wgLocalisationCacheConf; $wgMainCacheType = CACHE_NONE; $wgMessageCacheType = CACHE_NONE; $wgParserCacheType = CACHE_NONE; + $wgUseDatabaseMessages = false; # Set for future resets + + // Assume UTC for testing purposes + $wgLocaltimezone = 'UTC'; + + $wgLocalisationCacheConf['storeClass'] = 'LCStore_Null'; } public function execute() { } public function getDbType() { @@ -37,11 +44,6 @@ class PHPUnitMaintClass extends Maintenance { $maintClass = 'PHPUnitMaintClass'; require( RUN_MAINTENANCE_IF_MAIN ); -// Assume UTC for testing purposes -$wgLocaltimezone = 'UTC'; - -$wgLocalisationCacheConf['storeClass'] = 'LCStore_Null'; - if( !in_array( '--configuration', $_SERVER['argv'] ) ) { //Hack to eliminate the need to use the Makefile (which sucks ATM) $_SERVER['argv'][] = '--configuration'; -- 2.20.1