From 21070456b05fe2b1a0f27eb88d85280d1e0a2773 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Thu, 12 May 2016 11:35:20 -0700 Subject: [PATCH] Parser tests: Also register namespace 101 to accompany 100 It is expected that namespaces (except for NS_SPECIAL) will have a paired subject and talk namespace. While not having the accompanying talk namespace mostly works, it can cause unexpected issues when some code paths (e.g. WikiPage::onArticleCreate()) expect it to exist. Change-Id: I8f02fd886d0256679dfc10e1743204da4c6678b7 --- tests/parser/parserTest.inc | 1 + tests/phpunit/includes/parser/NewParserTest.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index ccb86d0efe..405f6a5cae 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -211,6 +211,7 @@ class ParserTest { # add a namespace shadowing a interwiki link, to test # proper precedence when resolving links. (bug 51680) $wgExtraNamespaces[100] = 'MemoryAlpha'; + $wgExtraNamespaces[101] = 'MemoryAlpha talk'; // XXX: tests won't run without this (for CACHE_DB) if ( $wgMainCacheType === CACHE_DB ) { diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php index 4c973e58d8..695f99a2e7 100644 --- a/tests/phpunit/includes/parser/NewParserTest.php +++ b/tests/phpunit/includes/parser/NewParserTest.php @@ -150,7 +150,10 @@ class NewParserTest extends MediaWikiTestCase { $tmpGlobals['wgHooks'] = $tmpHooks; # add a namespace shadowing a interwiki link, to test # proper precedence when resolving links. (bug 51680) - $tmpGlobals['wgExtraNamespaces'] = [ 100 => 'MemoryAlpha' ]; + $tmpGlobals['wgExtraNamespaces'] = [ + 100 => 'MemoryAlpha', + 101 => 'MemoryAlpha_talk' + ]; $tmpGlobals['wgLocalInterwikis'] = [ 'local', 'mi' ]; # "extra language links" -- 2.20.1