From: Brad Jorsch Date: Thu, 23 Feb 2017 21:14:54 +0000 (-0500) Subject: Make the parser tests' "subpage" option actually enable for all subpages X-Git-Tag: 1.31.0-rc.0~3913 X-Git-Url: http://git.cyclocoop.org/%27-%20%20.%20url_absolue%28find_in_path%28%27spip_style.css%27%29%29%20%20%20.%20url_absolue%28find_in_path%28%27prive/spip_style.css%27%29%29%20.%20%27?a=commitdiff_plain;h=69be6f316a290e92dba4e55161fe80a1bd0ca0db;p=lhc%2Fweb%2Fwiklou.git Make the parser tests' "subpage" option actually enable for all subpages The option says "enable subpages (disabled by default)", but it currently just enables subpages for namespaces 0 and 2. This tripped me up when writing some parser tests for TemplateStyles where I need subpages enabled for namespace 10. There's probably no reason not to have it enable subpages for all namespaces. Change-Id: Icf864dafc4208a76af7b3e71f5f9c97576c065b7 --- diff --git a/tests/parser/ParserTestRunner.php b/tests/parser/ParserTestRunner.php index 7edde2ae4b..35c2480d02 100644 --- a/tests/parser/ParserTestRunner.php +++ b/tests/parser/ParserTestRunner.php @@ -974,10 +974,9 @@ class ParserTestRunner { 'wgEnableUploads' => self::getOptionValue( 'wgEnableUploads', $opts, true ), 'wgLanguageCode' => $langCode, 'wgRawHtml' => self::getOptionValue( 'wgRawHtml', $opts, false ), - 'wgNamespacesWithSubpages' => [ - 0 => isset( $opts['subpage'] ), - 2 => isset( $opts['subpage'] ), - ], + 'wgNamespacesWithSubpages' => array_fill_keys( + MWNamespace::getValidNamespaces(), isset( $opts['subpage'] ) + ), 'wgMaxTocLevel' => $maxtoclevel, 'wgAllowExternalImages' => self::getOptionValue( 'wgAllowExternalImages', $opts, true ), 'wgThumbLimits' => [ self::getOptionValue( 'thumbsize', $opts, 180 ) ],