Merge "Improved fail-over in ReplicatedBagOStuff for redis"
[lhc/web/wiklou.git] / tests / phpunit / includes / parser / NewParserTest.php
index 3ce3e1f..c7a3103 100644 (file)
@@ -91,7 +91,7 @@ class NewParserTest extends MediaWikiTestCase {
                );
                $tmpGlobals['wgForeignFileRepos'] = array();
                $tmpGlobals['wgDefaultExternalStore'] = array();
-               $tmpGlobals['wgEnableParserCache'] = false;
+               $tmpGlobals['wgParserCacheType'] = CACHE_NONE;
                $tmpGlobals['wgCapitalLinks'] = true;
                $tmpGlobals['wgNoFollowLinks'] = true;
                $tmpGlobals['wgNoFollowDomainExceptions'] = array();
@@ -160,9 +160,6 @@ class NewParserTest extends MediaWikiTestCase {
                $this->djVuSupport = new DjVuSupport();
                // Tidy support
                $this->tidySupport = new TidySupport();
-               // We always set 'wgUseTidy' to false when parsing, but certain
-               // test-running modes still use tidy if available, so ensure
-               // that the tidy-related options are all set to their defaults.
                $tmpGlobals['wgUseTidy'] = false;
                $tmpGlobals['wgAlwaysUseTidy'] = false;
                $tmpGlobals['wgDebugTidy'] = false;
@@ -419,6 +416,7 @@ class NewParserTest extends MediaWikiTestCase {
                        'wgMathDirectory' => $uploadDir . '/math',
                        'wgDefaultLanguageVariant' => $variant,
                        'wgLinkHolderBatchSize' => $linkHolderBatchSize,
+                       'wgUseTidy' => isset( $opts['tidy'] ),
                );
 
                if ( $config ) {
@@ -727,12 +725,21 @@ class NewParserTest extends MediaWikiTestCase {
                                        . "Current configuration is:\n\$wgTexvc = '$wgTexvc'" );
                        }
                }
+
                if ( isset( $opts['djvu'] ) ) {
                        if ( !$this->djVuSupport->isEnabled() ) {
                                $this->markTestSkipped( "SKIPPED: djvu binaries do not exist or are not executable.\n" );
                        }
                }
 
+               if ( isset( $opts['tidy'] ) ) {
+                       if ( !$this->tidySupport->isEnabled() ) {
+                               $this->markTestSkipped( "SKIPPED: tidy extension is not installed.\n" );
+                       } else {
+                               $options->setTidy( true );
+                       }
+               }
+
                if ( isset( $opts['pst'] ) ) {
                        $out = $parser->preSaveTransform( $input, $title, $user, $options );
                } elseif ( isset( $opts['msg'] ) ) {
@@ -753,12 +760,7 @@ class NewParserTest extends MediaWikiTestCase {
                        $output->setTOCEnabled( !isset( $opts['notoc'] ) );
                        $out = $output->getText();
                        if ( isset( $opts['tidy'] ) ) {
-                               if ( !$this->tidySupport->isEnabled() ) {
-                                       $this->markTestSkipped( "SKIPPED: tidy extension is not installed.\n" );
-                               } else {
-                                       $out = MWTidy::tidy( $out );
-                                       $out = preg_replace( '/\s+$/', '', $out );
-                               }
+                               $out = preg_replace( '/\s+$/', '', $out );
                        }
 
                        if ( isset( $opts['showtitle'] ) ) {
@@ -769,6 +771,14 @@ class NewParserTest extends MediaWikiTestCase {
                                $out = "$title\n$out";
                        }
 
+                       if ( isset( $opts['showindicators'] ) ) {
+                               $indicators = '';
+                               foreach ( $output->getIndicators() as $id => $content ) {
+                                       $indicators .= "$id=$content\n";
+                               }
+                               $out = $indicators . $out;
+                       }
+
                        if ( isset( $opts['ill'] ) ) {
                                $out = implode( ' ', $output->getLanguageLinks() );
                        } elseif ( isset( $opts['cat'] ) ) {