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=3276cf98d4b082521b7142e59d54feb49f2fd3a4;hpb=67c63613de88d4919d232118e18fd91424697a0d;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/filerepo/StoreBatchTest.php b/tests/phpunit/includes/filerepo/StoreBatchTest.php index 3276cf98d4..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(); } @@ -132,14 +127,14 @@ class StoreBatchTest extends MediaWikiTestCase { global $IP; $this->storecohort( "Test1.png", - "$IP/skins/monobook/wiki.png", - "$IP/skins/monobook/video.png", + "$IP/tests/phpunit/data/filerepo/wiki.png", + "$IP/tests/phpunit/data/filerepo/video.png", false ); $this->storecohort( "Test2.png", - "$IP/skins/monobook/wiki.png", - "$IP/skins/monobook/video.png", + "$IP/tests/phpunit/data/filerepo/wiki.png", + "$IP/tests/phpunit/data/filerepo/video.png", true ); }