Merge "Revised styling of sister-search sidebar."
[lhc/web/wiklou.git] / tests / parser / ParserTestRunner.php
index 97e24b6..f44b0d5 100644 (file)
@@ -25,6 +25,7 @@
  * @file
  * @ingroup Testing
  */
+use Wikimedia\Rdbms\IDatabase;
 use MediaWiki\MediaWikiServices;
 use Wikimedia\ScopedCallback;
 
@@ -295,7 +296,7 @@ class ParserTestRunner {
                        MediaWikiServices::getInstance()->resetServiceForTesting( 'MediaHandlerFactory' );
                };
 
-               // SqlBagOStuff broke when using temporary tables on r40209 (bug 15892).
+               // SqlBagOStuff broke when using temporary tables on r40209 (T17892).
                // It seems to have been fixed since (r55079?), but regressed at some point before r85701.
                // This works around it for now...
                global $wgObjectCaches;
@@ -316,7 +317,7 @@ class ParserTestRunner {
 
        private function appendNamespaceSetup( &$setup, &$teardown ) {
                // Add a namespace shadowing a interwiki link, to test
-               // proper precedence when resolving links. (bug 51680)
+               // proper precedence when resolving links. (T53680)
                $setup['wgExtraNamespaces'] = [
                        100 => 'MemoryAlpha',
                        101 => 'MemoryAlpha_talk'
@@ -746,6 +747,10 @@ class ParserTestRunner {
                $user = $context->getUser();
                $options = ParserOptions::newFromContext( $context );
 
+               if ( !isset( $opts['wrap'] ) ) {
+                       $options->setWrapOutputClass( false );
+               }
+
                if ( isset( $opts['tidy'] ) ) {
                        if ( !$this->tidySupport->isEnabled() ) {
                                $this->recorder->skipped( $test, 'tidy extension is not installed' );
@@ -974,10 +979,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 ) ],
@@ -1321,7 +1325,7 @@ class ParserTestRunner {
                if ( $this->useTemporaryTables ) {
                        if ( $this->db->getType() == 'sqlite' ) {
                                # Under SQLite the searchindex table is virtual and need
-                               # to be explicitly destroyed. See bug 29912
+                               # to be explicitly destroyed. See T31912
                                # See also MediaWikiTestCase::destroyDB()
                                wfDebug( __METHOD__ . " explicitly destroying sqlite virtual table parsertest_searchindex\n" );
                                $this->db->query( "DROP TABLE `parsertest_searchindex`" );