Merge "Revert "maintenance: Update comment in the OOjs UI pull through script""
[lhc/web/wiklou.git] / tests / parser / parserTest.inc
index 5d52160..027c7b9 100644 (file)
@@ -69,11 +69,6 @@ class ParserTest {
         */
        private $djVuSupport;
 
-       /**
-        * @var string $oldTablePrefix Original table prefix
-        */
-       private $oldTablePrefix;
-
        private $maxFuzzTestLength = 300;
        private $fuzzSeed = 0;
        private $memoryLimit = 50;
@@ -153,6 +148,7 @@ class ParserTest {
                global $wgParser, $wgParserConf, $IP, $messageMemc, $wgMemc,
                        $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgEnableParserCache,
                        $wgExtraNamespaces, $wgNamespaceAliases, $wgNamespaceProtection, $wgLocalFileRepo,
+                       $wgExtraInterlanguageLinkPrefixes, $wgLocalInterwikis,
                        $parserMemc, $wgThumbnailScriptPath, $wgScriptPath,
                        $wgArticlePath, $wgScript, $wgStylePath, $wgExtensionAssetsPath,
                        $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgLockManagers;
@@ -225,6 +221,10 @@ class ParserTest {
                }
 
                self::setupInterwikis();
+               $wgLocalInterwikis = array( 'local', 'mi' );
+               // "extra language links"
+               // see https://gerrit.wikimedia.org/r/111390
+               array_push( $wgExtraInterlanguageLinkPrefixes, 'mul' );
        }
 
        /**
@@ -241,6 +241,11 @@ class ParserTest {
                # for testing inter-language links
                Hooks::register( 'InterwikiLoadPrefix', function ( $prefix, &$iwData ) {
                        static $testInterwikis = array(
+                               'local' => array(
+                                       'iw_url' => 'http://doesnt.matter.org/$1',
+                                       'iw_api' => '',
+                                       'iw_wikiid' => '',
+                                       'iw_local' => 0 ),
                                'wikipedia' => array(
                                        'iw_url' => 'http://en.wikipedia.org/wiki/$1',
                                        'iw_api' => '',
@@ -276,6 +281,16 @@ class ParserTest {
                                        'iw_api' => '',
                                        'iw_wikiid' => '',
                                        'iw_local' => 1 ),
+                               'mi' => array(
+                                       'iw_url' => 'http://mi.wikipedia.org/wiki/$1',
+                                       'iw_api' => '',
+                                       'iw_wikiid' => '',
+                                       'iw_local' => 1 ),
+                               'mul' => array(
+                                       'iw_url' => 'http://wikisource.org/wiki/$1',
+                                       'iw_api' => '',
+                                       'iw_wikiid' => '',
+                                       'iw_local' => 1 ),
                        );
                        if ( array_key_exists( $prefix, $testInterwikis ) ) {
                                $iwData = $testInterwikis[$prefix];
@@ -933,7 +948,6 @@ class ParserTest {
                }
 
                $this->databaseSetupDone = true;
-               $this->oldTablePrefix = $wgDBprefix;
 
                # SqlBagOStuff broke when using temporary tables on r40209 (bug 15892).
                # It seems to have been fixed since (r55079?), but regressed at some point before r85701.