Merge "wgUseMediaWikiUIEverywhere false in Html/XmlTest"
[lhc/web/wiklou.git] / tests / parser / parserTest.inc
index c42ff30..56108c9 100644 (file)
@@ -195,7 +195,7 @@ class ParserTest {
                        'transformVia404' => false,
                        'backend' => new FSFileBackend( [
                                'name' => 'local-backend',
-                               'wikiId' => wfWikiId(),
+                               'wikiId' => wfWikiID(),
                                'containerPaths' => [
                                        'local-public' => $this->uploadDir . '/public',
                                        'local-thumb' => $this->uploadDir . '/thumb',
@@ -227,12 +227,13 @@ class ParserTest {
                $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";
@@ -618,6 +619,7 @@ class ParserTest {
                        $titleText = 'Parser test';
                }
 
+               ObjectCache::getMainWANInstance()->clearProcessCache();
                $local = isset( $opts['local'] );
                $preprocessor = isset( $opts['preprocessor'] ) ? $opts['preprocessor'] : null;
                $parser = $this->getParser( $preprocessor );
@@ -848,7 +850,7 @@ class ParserTest {
                                'transformVia404' => false,
                                'backend' => new FSFileBackend( [
                                        'name' => 'local-backend',
-                                       'wikiId' => wfWikiId(),
+                                       'wikiId' => wfWikiID(),
                                        'containerPaths' => [
                                                'local-public' => $this->uploadDir,
                                                'local-thumb' => $this->uploadDir . '/thumb',
@@ -895,7 +897,6 @@ class ParserTest {
                        'wgExternalLinkTarget' => false,
                        'wgHtml5' => true,
                        'wgWellFormedXml' => true,
-                       'wgAllowMicrodataAttributes' => true,
                        'wgAdaptiveMessageCache' => true,
                        'wgDisableLangConversion' => false,
                        'wgDisableTitleConversion' => false,
@@ -931,10 +932,12 @@ class ParserTest {
                        $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();