From: Kunal Mehta Date: Thu, 12 May 2016 18:35:20 +0000 (-0700) Subject: Parser tests: Also register namespace 101 to accompany 100 X-Git-Tag: 1.31.0-rc.0~6996^2 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=21070456b05fe2b1a0f27eb88d85280d1e0a2773;p=lhc%2Fweb%2Fwiklou.git 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 --- 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"