<?php
+use MediaWiki\MediaWikiServices;
+
require_once dirname( __DIR__ ) . '/includes/upload/UploadFromUrlTest.php';
class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
}
protected function setUp() {
- global $wgParser, $wgParserConf, $IP, $messageMemc, $wgMemc, $wgUser,
- $wgLang, $wgOut, $wgRequest, $wgStyleDirectory,
+ global $IP, $messageMemc, $wgMemc, $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory,
$wgParserCacheType, $wgNamespaceAliases, $wgNamespaceProtection;
$tmpDir = $this->getNewTempDirectory();
$wgParserCacheType = CACHE_NONE;
DeferredUpdates::clearPendingUpdates();
- $wgMemc = wfGetMainCache();
+ $wgMemc = ObjectCache::getLocalClusterInstance();
$messageMemc = wfGetMessageCacheStorage();
RequestContext::resetMain();
$wgUser = new User;
$wgLang = $context->getLanguage();
$wgOut = $context->getOutput();
- $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], [ $wgParserConf ] );
$wgRequest = $context->getRequest();
if ( $wgStyleDirectory === false ) {
$wgStyleDirectory = "$IP/skins";
}
- RepoGroup::destroySingleton();
+ MediaWikiServices::getInstance()->resetServiceForTesting( 'RepoGroup' );
FileBackendGroup::destroySingleton();
}
$GLOBALS[$var] = $val;
}
// Restore backends
- RepoGroup::destroySingleton();
+ MediaWikiServices::getInstance()->resetServiceForTesting( 'RepoGroup' );
FileBackendGroup::destroySingleton();
parent::tearDown();