Abstract and refactor Tidy support
[lhc/web/wiklou.git] / tests / phpunit / includes / parser / NewParserTest.php
index ccd7f96..0d2129b 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,10 +160,10 @@ class NewParserTest extends MediaWikiTestCase {
                $this->djVuSupport = new DjVuSupport();
                // Tidy support
                $this->tidySupport = new TidySupport();
+               $tmpGlobals['wgTidyConfig'] = null;
                $tmpGlobals['wgUseTidy'] = false;
-               $tmpGlobals['wgAlwaysUseTidy'] = false;
                $tmpGlobals['wgDebugTidy'] = false;
-               $tmpGlobals['wgTidyConf'] = $IP . '/includes/tidy.conf';
+               $tmpGlobals['wgTidyConf'] = $IP . '/includes/tidy/tidy.conf';
                $tmpGlobals['wgTidyOpts'] = '';
                $tmpGlobals['wgTidyInternal'] = $this->tidySupport->isInternal();
 
@@ -185,6 +185,8 @@ class NewParserTest extends MediaWikiTestCase {
                $wgNamespaceAliases['Image'] = $this->savedWeirdGlobals['image_alias'];
                $wgNamespaceAliases['Image_talk'] = $this->savedWeirdGlobals['image_talk_alias'];
 
+               MWTidy::destroySingleton();
+
                // Restore backends
                RepoGroup::destroySingleton();
                FileBackendGroup::destroySingleton();
@@ -454,6 +456,7 @@ class NewParserTest extends MediaWikiTestCase {
                        $GLOBALS[$var] = $val;
                }
 
+               MWTidy::destroySingleton();
                MagicWord::clearCache();
 
                # The entries saved into RepoGroup cache with previous globals will be wrong.
@@ -771,6 +774,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'] ) ) {