'transformVia404' => false,
'backend' => new FSFileBackend( [
'name' => 'local-backend',
- 'wikiId' => wfWikiId(),
+ 'wikiId' => wfWikiID(),
'containerPaths' => [
'local-public' => $this->uploadDir . '/public',
'local-thumb' => $this->uploadDir . '/thumb',
$messageMemc = wfGetMessageCacheStorage();
$parserMemc = wfGetParserCacheStorage();
- $wgUser = new User;
+ RequestContext::resetMain();
$context = new RequestContext;
+ $wgUser = new User;
$wgLang = $context->getLanguage();
$wgOut = $context->getOutput();
- $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], [ $wgParserConf ] );
$wgRequest = $context->getRequest();
+ $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], [ $wgParserConf ] );
if ( $wgStyleDirectory === false ) {
$wgStyleDirectory = "$IP/skins";
$titleText = 'Parser test';
}
+ ObjectCache::getMainWANInstance()->clearProcessCache();
$local = isset( $opts['local'] );
$preprocessor = isset( $opts['preprocessor'] ) ? $opts['preprocessor'] : null;
$parser = $this->getParser( $preprocessor );
'wgServer' => 'http://example.org',
'wgServerName' => 'example.org',
'wgScript' => '/index.php',
- 'wgScriptPath' => '/',
+ 'wgScriptPath' => '',
'wgArticlePath' => '/wiki/$1',
'wgActionPaths' => [],
'wgLockManagers' => [ [
'transformVia404' => false,
'backend' => new FSFileBackend( [
'name' => 'local-backend',
- 'wikiId' => wfWikiId(),
+ 'wikiId' => wfWikiID(),
'containerPaths' => [
'local-public' => $this->uploadDir,
'local-thumb' => $this->uploadDir . '/thumb',
'wgExternalLinkTarget' => false,
'wgHtml5' => true,
'wgWellFormedXml' => true,
- 'wgAllowMicrodataAttributes' => true,
'wgAdaptiveMessageCache' => true,
'wgDisableLangConversion' => false,
'wgDisableTitleConversion' => false,
$GLOBALS[$var] = $val;
}
+ // Must be set before $context as user language defaults to $wgContLang
$GLOBALS['wgContLang'] = Language::factory( $lang );
$GLOBALS['wgMemc'] = new EmptyBagOStuff;
- $context = new RequestContext();
+ RequestContext::resetMain();
+ $context = RequestContext::getMain();
$GLOBALS['wgLang'] = $context->getLanguage();
$GLOBALS['wgOut'] = $context->getOutput();
$GLOBALS['wgUser'] = $context->getUser();