Merge "phpunit: Replace APC with HashBagOStuff during a test"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 25 Sep 2015 00:32:55 +0000 (00:32 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 25 Sep 2015 00:32:55 +0000 (00:32 +0000)
tests/phpunit/MediaWikiTestCase.php

index ec95665..73c4066 100644 (file)
@@ -103,6 +103,12 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                 */
                ObjectCache::$instances[CACHE_DB] = new HashBagOStuff;
 
+               // Sandbox APC by replacing with in-process hash cache instead.
+               // Ensures tests are removed between tests.
+               ObjectCache::$instances['apc'] =
+               ObjectCache::$instances['xcache'] =
+               ObjectCache::$instances['wincache'] = new HashBagOStuff;
+
                $needsResetDB = false;
 
                if ( $this->needsDB() ) {