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;
$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() {
* @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 );