Add parser test for "extra interlanguage links".
authorC. Scott Ananian <cscott@cscott.net>
Thu, 26 Jun 2014 21:50:46 +0000 (17:50 -0400)
committerCscott <cananian@wikimedia.org>
Thu, 26 Jun 2014 22:46:13 +0000 (22:46 +0000)
This support was added in https://gerrit.wikimedia.org/r/111390
but no parser tests were added at that time.

Bug: 32189
Change-Id: I299ce844919b3f20b3ce116adf64b37dd95325d0

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 03e4959..b8ba403 100644 (file)
@@ -6413,6 +6413,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();