Fix DjVu tests isolation

Change-Id: I97177572fc025c5ab4361146253d7df9c487c291
This commit is contained in:
Max Semenik 2014-07-15 16:56:34 -07:00
parent 8ad5719e2c
commit da300d4432
2 changed files with 9 additions and 0 deletions

View file

@ -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.

View file

@ -246,6 +246,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
}
$this->mwGlobals = array();
RequestContext::resetMain();
MediaHandler::resetCache();
$phpErrorLevel = intval( ini_get( 'error_reporting' ) );