Also clean up the other cache settings to match their order
as defined in DefaultSettings.php.
Don't disable MessageCacheType, ParserCacheType etc. This could
prevent bugs from happening during tests. They are enabled by default
in MediaWiki with CACHE_ANYTHING. At least let them use 'hash'
during tests to resemble a more realistic environment.
Change-Id: Id9edf33c600db3ac4d837e1674a8eb2f5363a4f8
*/
ObjectCache::$instances[CACHE_DB] = new HashBagOStuff;
*/
ObjectCache::$instances[CACHE_DB] = new HashBagOStuff;
- // Sandbox APC by replacing with in-process hash cache instead.
- // Ensures tests are removed between tests.
+ // Sandbox APC by replacing with in-process hash instead.
+ // Ensures values are removed between tests.
ObjectCache::$instances['apc'] =
ObjectCache::$instances['xcache'] =
ObjectCache::$instances['wincache'] = new HashBagOStuff;
ObjectCache::$instances['apc'] =
ObjectCache::$instances['xcache'] =
ObjectCache::$instances['wincache'] = new HashBagOStuff;
// wfWarn should cause tests to fail
$wgDevelopmentWarnings = true;
// wfWarn should cause tests to fail
$wgDevelopmentWarnings = true;
+ // Make sure all caches and stashes are either disabled or use
+ // in-process cache only to prevent tests from using any preconfigured
+ // cache meant for the local wiki from outside the test run.
+ // See also MediaWikiTestCase::run() which mocks CACHE_DB and APC.
+
+ // Disabled in DefaultSettings, override local settings
+ $wgMainWANCache =
$wgMainCacheType = CACHE_NONE;
$wgMainCacheType = CACHE_NONE;
- $wgMainWANCache = CACHE_NONE;
- $wgMessageCacheType = CACHE_NONE;
- $wgParserCacheType = CACHE_NONE;
- $wgLanguageConverterCacheType = CACHE_NONE;
+ // Uses CACHE_ANYTHING in DefaultSettings, use hash instead of db
+ $wgMessageCacheType =
+ $wgParserCacheType =
+ $wgSessionCacheType =
+ $wgLanguageConverterCacheType = 'hash';
+ // Uses db-replicated in DefaultSettings
+ $wgMainStash = 'hash';
$wgUseDatabaseMessages = false; # Set for future resets
$wgUseDatabaseMessages = false; # Set for future resets