https://www.mediawiki.org/wiki/Special:Code/MediaWiki/109641

Revision: 109641
Author:   platonides
Date:     2012-01-20 20:15:26 +0000 (Fri, 20 Jan 2012)
Log Message:
-----------
Fix folder leakage.

Modified Paths:
--------------
    trunk/phase3/tests/phpunit/includes/filerepo/StoreBatchTest.php

Modified: trunk/phase3/tests/phpunit/includes/filerepo/StoreBatchTest.php
===================================================================
--- trunk/phase3/tests/phpunit/includes/filerepo/StoreBatchTest.php     
2012-01-20 19:46:27 UTC (rev 109640)
+++ trunk/phase3/tests/phpunit/includes/filerepo/StoreBatchTest.php     
2012-01-20 20:15:26 UTC (rev 109641)
@@ -8,17 +8,17 @@
                parent::setUp();
 
                # Forge a FSRepo object to not have to rely on local wiki 
settings
-               $tmpDir = wfTempDir() . '/' . time() . '-' . mt_rand();
+               $this->tmpDir = wfTempDir() . '/store-batch-test-' . time() . 
'-' . mt_rand();
                $this->repo = new FSRepo( array(
                        'name'    => 'test',
                        'backend' => new FSFileBackend( array(
                                'name'        => 'local-backend',
                                'lockManager' => 'nullLockManager',
                                'containerPaths' => array(
-                                       'test-public'  => "$tmpDir/public",
-                                       'test-thumb'   => "$tmpDir/thumb",
-                                       'test-temp'    => "$tmpDir/temp",
-                                       'test-deleted' => "$tmpDir/deleted",
+                                       'test-public'  => $this->tmpDir . 
"/public",
+                                       'test-thumb'   => $this->tmpDir . 
"/thumb",
+                                       'test-temp'    => $this->tmpDir . 
"/temp",
+                                       'test-deleted' => $this->tmpDir . 
"/deleted",
                                )
                        ) )
                ) );
@@ -116,6 +116,9 @@
 
        public function tearDown() {
                $this->repo->cleanupBatch( $this->createdFiles );
+               foreach ( array( "temp/0/06", "temp/0", "temp/4/4d", "temp/4", 
"temp/3/31", "temp/3", "temp", "" ) as $tmp ) {
+                       rmdir( $this->tmpDir . "/" . $tmp );
+               }
                parent::tearDown();
        }
 }


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to