Parser tests: Also register namespace 101 to accompany 100
authorKunal Mehta <legoktm@member.fsf.org>
Thu, 12 May 2016 18:35:20 +0000 (11:35 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Thu, 12 May 2016 18:37:00 +0000 (11:37 -0700)
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
tests/phpunit/includes/parser/NewParserTest.php

index ccb86d0..405f6a5 100644 (file)
@@ -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 ) {
index 4c973e5..695f99a 100644 (file)
@@ -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"