From: C. Scott Ananian
Date: Thu, 26 Jun 2014 21:50:46 +0000 (-0400)
Subject: Add parser test for "extra interlanguage links".
X-Git-Tag: 1.31.0-rc.0~15204^2
X-Git-Url: http://git.cyclocoop.org/%22.htmlspecialchars%28%24url_syndic%29.%22?a=commitdiff_plain;h=09498e1d7fecb272d49085c553ad19be3e4958b6;p=lhc%2Fweb%2Fwiklou.git
Add parser test for "extra interlanguage links".
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
---
diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc
index 5d521608a7..6c8a4012c2 100644
--- a/tests/parser/parserTest.inc
+++ b/tests/parser/parserTest.inc
@@ -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];
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index 03e4959d0f..b8ba403ceb 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -6413,6 +6413,16 @@ Blah blah blah
!! end
+!! test
+"Extra" interlanguage links (bug 32189 / gerrit 111390)
+!! wikitext
+Blah blah blah
+[[mul:Multilingual]]
+!! html
+Blah blah blah
+
+!! end
+
!! test
Parsoid-specific test: Wikilinks with should RT properly
!! options
diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php
index 5c42faecb0..4c72d1c9e4 100644
--- a/tests/phpunit/includes/parser/NewParserTest.php
+++ b/tests/phpunit/includes/parser/NewParserTest.php
@@ -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();