Fix Sqlite upgrade test when profiling to database is enabled
[lhc/web/wiklou.git] / tests / phpunit / includes / filerepo / StoreBatchTest.php
index 3ab56af..7d815e9 100644 (file)
@@ -5,7 +5,7 @@
  */
 class StoreBatchTest extends MediaWikiTestCase {
 
-       public function setUp() {
+       protected function setUp() {
                global $wgFileBackends;
                parent::setUp();
 
@@ -43,6 +43,17 @@ class StoreBatchTest extends MediaWikiTestCase {
                $this->createdFiles = array();
        }
 
+       protected function tearDown() {
+               $this->repo->cleanupBatch( $this->createdFiles ); // delete files
+               foreach ( $this->createdFiles as $tmp ) { // delete dirs
+                       $tmp = $this->repo->resolveVirtualUrl( $tmp );
+                       while ( $tmp = FileBackend::parentStoragePath( $tmp ) ) {
+                               $this->repo->getBackend()->clean( array( 'dir' => $tmp ) );
+                       }
+               }
+               parent::tearDown();
+       }
+
        /**
         * Store a file or virtual URL source into a media file name.
         *
@@ -109,15 +120,4 @@ class StoreBatchTest extends MediaWikiTestCase {
                $this->storecohort( "Test1.png", "$IP/skins/monobook/wiki.png", "$IP/skins/monobook/video.png", false );
                $this->storecohort( "Test2.png", "$IP/skins/monobook/wiki.png", "$IP/skins/monobook/video.png", true );
        }
-
-       public function tearDown() {
-               $this->repo->cleanupBatch( $this->createdFiles ); // delete files
-               foreach ( $this->createdFiles as $tmp ) { // delete dirs
-                       $tmp = $this->repo->resolveVirtualUrl( $tmp );
-                       while ( $tmp = FileBackend::parentStoragePath( $tmp ) ) {
-                               $this->repo->getBackend()->clean( array( 'dir' => $tmp ) );
-                       }
-               }
-               parent::tearDown();
-       }
 }