summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/filerepo/StoreBatchTest.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-06-04 07:31:04 +0200
committerPierre Schmitz <pierre@archlinux.de>2015-06-04 07:58:39 +0200
commitf6d65e533c62f6deb21342d4901ece24497b433e (patch)
treef28adf0362d14bcd448f7b65a7aaf38650f923aa /tests/phpunit/includes/filerepo/StoreBatchTest.php
parentc27b2e832fe25651ef2410fae85b41072aae7519 (diff)
Update to MediaWiki 1.25.1
Diffstat (limited to 'tests/phpunit/includes/filerepo/StoreBatchTest.php')
-rw-r--r--tests/phpunit/includes/filerepo/StoreBatchTest.php19
1 files changed, 7 insertions, 12 deletions
diff --git a/tests/phpunit/includes/filerepo/StoreBatchTest.php b/tests/phpunit/includes/filerepo/StoreBatchTest.php
index 9cc2efbf..86bfe123 100644
--- a/tests/phpunit/includes/filerepo/StoreBatchTest.php
+++ b/tests/phpunit/includes/filerepo/StoreBatchTest.php
@@ -16,7 +16,7 @@ class StoreBatchTest extends MediaWikiTestCase {
parent::setUp();
# Forge a FSRepo object to not have to rely on local wiki settings
- $tmpPrefix = wfTempDir() . '/storebatch-test-' . time() . '-' . mt_rand();
+ $tmpPrefix = $this->getNewTempDirectory();
if ( $this->getCliArg( 'use-filebackend' ) ) {
$name = $this->getCliArg( 'use-filebackend' );
$useConfig = array();
@@ -35,10 +35,10 @@ class StoreBatchTest extends MediaWikiTestCase {
'name' => 'local-testing',
'wikiId' => wfWikiID(),
'containerPaths' => array(
- 'unittests-public' => "{$tmpPrefix}-public",
- 'unittests-thumb' => "{$tmpPrefix}-thumb",
- 'unittests-temp' => "{$tmpPrefix}-temp",
- 'unittests-deleted' => "{$tmpPrefix}-deleted",
+ 'unittests-public' => "{$tmpPrefix}/public",
+ 'unittests-thumb' => "{$tmpPrefix}/thumb",
+ 'unittests-temp' => "{$tmpPrefix}/temp",
+ 'unittests-deleted' => "{$tmpPrefix}/deleted",
)
) );
}
@@ -52,13 +52,8 @@ class StoreBatchTest extends MediaWikiTestCase {
}
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 ) );
- }
- }
+ // Delete files
+ $this->repo->cleanupBatch( $this->createdFiles );
parent::tearDown();
}