docs: Remove odd colons after @todo
[lhc/web/wiklou.git] / tests / phpunit / includes / parser / NewParserTest.php
index 3449cc7..e0158a2 100644 (file)
@@ -59,7 +59,6 @@ class NewParserTest extends MediaWikiTestCase {
                $tmpGlobals['wgActionPaths'] = array();
                $tmpGlobals['wgVariantArticlePath'] = false;
                $tmpGlobals['wgExtensionAssetsPath'] = '/extensions';
-               $tmpGlobals['wgStyleSheetPath'] = '/skins';
                $tmpGlobals['wgStylePath'] = '/skins';
                $tmpGlobals['wgEnableUploads'] = true;
                $tmpGlobals['wgThumbnailScriptPath'] = false;
@@ -111,6 +110,14 @@ class NewParserTest extends MediaWikiTestCase {
                        $tmpGlobals['wgStyleDirectory'] = "$IP/skins";
                }
 
+               # Replace all media handlers with a mock. We do not need to generate
+               # actual thumbnails to do parser testing, we only care about receiving
+               # a ThumbnailImage properly initialized.
+               global $wgMediaHandlers;
+               foreach( $wgMediaHandlers as $type => $handler ) {
+                       $tmpGlobals['wgMediaHandlers'][$type] = 'MockBitmapHandler';
+               }
+
                $tmpHooks = $wgHooks;
                $tmpHooks['ParserTestParser'][] = 'ParserTestParserHook::setup';
                $tmpHooks['ParserGetVariableValueTs'][] = 'ParserTest::getFakeTimestamp';
@@ -302,7 +309,10 @@ class NewParserTest extends MediaWikiTestCase {
                                $backend = self::$backendToUse;
                        }
                } else {
-                       $backend = new FSFileBackend( array(
+                       # Replace with a mock. We do not care about generating real
+                       # files on the filesystem, just need to expose the file
+                       # informations.
+                       $backend = new MockFileBackend( array(
                                'name' => 'local-backend',
                                'lockManager' => 'nullLockManager',
                                'containerPaths' => array(
@@ -457,6 +467,12 @@ class NewParserTest extends MediaWikiTestCase {
                        return;
                }
 
+               $backend = RepoGroup::singleton()->getLocalRepo()->getBackend();
+               if( $backend instanceof MockFileBackend ) {
+                       # In memory backend, so dont bother cleaning them up.
+                       return;
+               }
+
                $base = $this->getBaseDir();
                // delete the files first, then the dirs.
                self::deleteFiles(
@@ -538,7 +554,7 @@ class NewParserTest extends MediaWikiTestCase {
 
                if ( !$this->isWikitextNS( NS_MAIN ) ) {
                        // parser tests frequently assume that the main namespace contains wikitext.
-                       // @todo: When setting up pages, force the content model. Only skip if
+                       // @todo When setting up pages, force the content model. Only skip if
                        //        $wgtContentModelUseDB is false.
                        $this->markTestSkipped( "Main namespace does not support wikitext,"
                                . "skipping parser test: $desc" );