From 09498e1d7fecb272d49085c553ad19be3e4958b6 Mon Sep 17 00:00:00 2001
From: "C. Scott Ananian"
Date: Thu, 26 Jun 2014 17:50:46 -0400
Subject: [PATCH] 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
---
tests/parser/parserTest.inc | 9 +++++++++
tests/parser/parserTests.txt | 10 ++++++++++
tests/phpunit/includes/parser/NewParserTest.php | 4 ++++
3 files changed, 23 insertions(+)
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();
--
2.20.1