X-Git-Url: https://git.heureux-cyclage.org/index.php?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Ffilerepo%2FStoreBatchTest.php;h=86bfe123ab5af0cda48f7a798d5b147568f44abc;hb=b767edc892b81c3be688b9f4a4004433e9c5132c;hp=a79866efcbf3bda6e1971d451d8833250f75b0c3;hpb=7e3d257fc5b952740daaa5a80180930967f21304;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/filerepo/StoreBatchTest.php b/tests/phpunit/includes/filerepo/StoreBatchTest.php index a79866efcb..86bfe123ab 100644 --- a/tests/phpunit/includes/filerepo/StoreBatchTest.php +++ b/tests/phpunit/includes/filerepo/StoreBatchTest.php @@ -16,9 +16,9 @@ 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(); - if ( $this->getCliArg( 'use-filebackend=' ) ) { - $name = $this->getCliArg( 'use-filebackend=' ); + $tmpPrefix = $this->getNewTempDirectory(); + if ( $this->getCliArg( 'use-filebackend' ) ) { + $name = $this->getCliArg( 'use-filebackend' ); $useConfig = array(); foreach ( $wgFileBackends as $conf ) { if ( $conf['name'] == $name ) { @@ -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(); }