Fix Sqlite upgrade test when profiling to database is enabled
[lhc/web/wiklou.git] / tests / phpunit / includes / filerepo / StoreBatchTest.php
index 700c962..7d815e9 100644 (file)
@@ -1,10 +1,11 @@
 <?php
 /**
  * @group FileRepo
+ * @group medium
  */
 class StoreBatchTest extends MediaWikiTestCase {
 
-       public function setUp() {
+       protected function setUp() {
                global $wgFileBackends;
                parent::setUp();
 
@@ -18,12 +19,12 @@ class StoreBatchTest extends MediaWikiTestCase {
                                        $useConfig = $conf;
                                }
                        }
-                       $useConfig['name'] = 'localtesting'; // swap name
-                       $class = $conf['class'];
-                       self::$backendToUse = new $class( $useConfig );
+                       $useConfig['name'] = 'local-testing'; // swap name
+                       $class = $useConfig['class'];
+                       $backend = new $class( $useConfig );
                } else {
                        $backend = new FSFileBackend( array(
-                               'name'        => 'local-backend',
+                               'name'        => 'local-testing',
                                'lockManager' => 'nullLockManager',
                                'containerPaths' => array(
                                        'unittests-public'  => "{$tmpPrefix}-public",
@@ -42,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.
         *
@@ -108,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();
-       }
 }