Merge "Add parser test for "extra interlanguage links"."
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 27 Jun 2014 14:04:26 +0000 (14:04 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 27 Jun 2014 14:04:26 +0000 (14:04 +0000)
tests/parser/parserTest.inc
tests/parser/parserTests.txt
tests/phpunit/includes/parser/NewParserTest.php

index 5d52160..6c8a401 100644 (file)
@@ -153,6 +153,7 @@ class ParserTest {
                global $wgParser, $wgParserConf, $IP, $messageMemc, $wgMemc,
                        $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgEnableParserCache,
                        $wgExtraNamespaces, $wgNamespaceAliases, $wgNamespaceProtection, $wgLocalFileRepo,
+                       $wgExtraInterlanguageLinkPrefixes,
                        $parserMemc, $wgThumbnailScriptPath, $wgScriptPath,
                        $wgArticlePath, $wgScript, $wgStylePath, $wgExtensionAssetsPath,
                        $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgLockManagers;
@@ -223,6 +224,9 @@ class ParserTest {
                if ( $wgStyleDirectory === false ) {
                        $wgStyleDirectory = "$IP/skins";
                }
+               // "extra language links"
+               // see https://gerrit.wikimedia.org/r/111390
+               array_push( $wgExtraInterlanguageLinkPrefixes, 'mul' );
 
                self::setupInterwikis();
        }
@@ -276,6 +280,11 @@ class ParserTest {
                                        '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];
index f6238bb..e4d9324 100644 (file)
@@ -6407,6 +6407,16 @@ Blah blah blah
 </p>
 !! end
 
+!! test
+"Extra" interlanguage links (bug 32189 / gerrit 111390)
+!! wikitext
+Blah blah blah
+[[mul:Multilingual]]
+!! html
+<p>Blah blah blah
+</p>
+!! end
+
 !! test
 Parsoid-specific test: Wikilinks with &nbsp; should RT properly
 !! options
index 5c42fae..4c72d1c 100644 (file)
@@ -148,6 +148,10 @@ class NewParserTest extends MediaWikiTestCase {
                # proper precedence when resolving links. (bug 51680)
                $tmpGlobals['wgExtraNamespaces'] = array( 100 => 'MemoryAlpha' );
 
+               # "extra language links"
+               # see https://gerrit.wikimedia.org/r/111390
+               $tmpGlobals['wgExtraInterlanguageLinkPrefixes'] = array( 'mul' );
+
                //DjVu support
                $this->djVuSupport = new DjVuSupport();