X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Ffilerepo%2FStoreBatchTest.php;h=337c65c4b763295ebfd96ae5935fca3d7491b6e9;hb=2ab7ae9d24009f8cd7555cdbd15c9a852b1cc4db;hp=86bfe123ab5af0cda48f7a798d5b147568f44abc;hpb=845f1bf0c8f228c877ef491f316d8266f832b210;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/filerepo/StoreBatchTest.php b/tests/phpunit/includes/filerepo/StoreBatchTest.php index 86bfe123ab..337c65c4b7 100644 --- a/tests/phpunit/includes/filerepo/StoreBatchTest.php +++ b/tests/phpunit/includes/filerepo/StoreBatchTest.php @@ -15,11 +15,11 @@ class StoreBatchTest extends MediaWikiTestCase { global $wgFileBackends; parent::setUp(); - # Forge a FSRepo object to not have to rely on local wiki settings + # Forge a FileRepo object to not have to rely on local wiki settings $tmpPrefix = $this->getNewTempDirectory(); if ( $this->getCliArg( 'use-filebackend' ) ) { $name = $this->getCliArg( 'use-filebackend' ); - $useConfig = array(); + $useConfig = []; foreach ( $wgFileBackends as $conf ) { if ( $conf['name'] == $name ) { $useConfig = $conf; @@ -31,24 +31,24 @@ class StoreBatchTest extends MediaWikiTestCase { $class = $useConfig['class']; $backend = new $class( $useConfig ); } else { - $backend = new FSFileBackend( array( + $backend = new FSFileBackend( [ 'name' => 'local-testing', 'wikiId' => wfWikiID(), - 'containerPaths' => array( + 'containerPaths' => [ 'unittests-public' => "{$tmpPrefix}/public", 'unittests-thumb' => "{$tmpPrefix}/thumb", 'unittests-temp' => "{$tmpPrefix}/temp", 'unittests-deleted' => "{$tmpPrefix}/deleted", - ) - ) ); + ] + ] ); } - $this->repo = new FileRepo( array( + $this->repo = new FileRepo( [ 'name' => 'unittests', 'backend' => $backend - ) ); + ] ); $this->date = gmdate( "YmdHis" ); - $this->createdFiles = array(); + $this->createdFiles = []; } protected function tearDown() { @@ -63,7 +63,7 @@ class StoreBatchTest extends MediaWikiTestCase { * @param string $originalName The title of the image * @param string $srcPath The filepath or virtual URL * @param int $flags Flags to pass into repo::store(). - * @return FileRepoStatus + * @return Status */ private function storeit( $originalName, $srcPath, $flags ) { $hashPath = $this->repo->getHashPath( $originalName );