From: Max Semenik Date: Tue, 15 Jul 2014 23:56:34 +0000 (-0700) Subject: Fix DjVu tests isolation X-Git-Tag: 1.31.0-rc.0~14932^2 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=da300d4432f4ee05d91a2cdce78b15919bd43135;p=lhc%2Fweb%2Fwiklou.git Fix DjVu tests isolation Change-Id: I97177572fc025c5ab4361146253d7df9c487c291 --- diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php index c4aab7be9f..26126857d7 100644 --- a/includes/media/MediaHandler.php +++ b/includes/media/MediaHandler.php @@ -56,6 +56,7 @@ abstract class MediaHandler { if ( !isset( self::$handlers[$class] ) ) { self::$handlers[$class] = new $class; if ( !self::$handlers[$class]->isEnabled() ) { + wfDebug( __METHOD__ . ": $class is not enabled\n" ); self::$handlers[$class] = false; } } @@ -63,6 +64,13 @@ abstract class MediaHandler { return self::$handlers[$class]; } + /** + * Resets all static caches + */ + public static function resetCache() { + self::$handlers = array(); + } + /** * Get an associative array mapping magic word IDs to parameter names. * Will be used by the parser to identify parameters. diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index c9184e8534..301589542c 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -246,6 +246,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { } $this->mwGlobals = array(); RequestContext::resetMain(); + MediaHandler::resetCache(); $phpErrorLevel = intval( ini_get( 'error_reporting' ) );