<?php
/**
* @group FileRepo
+ * @group medium
*/
class StoreBatchTest extends MediaWikiTestCase {
- public function setUp() {
+ protected function setUp() {
global $wgFileBackends;
parent::setUp();
$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",
$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.
*
$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();
- }
}