X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fapi%2FApiTestCaseUpload.php;h=f15da2ee91ab9009262a882625b19ebb6b5f5da3;hb=199df046c48a29c9ae2ea6194dad664ffc8fb9f8;hp=b6ae6415663fa62ca671389bbc26c2fd3f70f7bd;hpb=23299ca8790bcf1aebcf54e0932b94338e630474;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/api/ApiTestCaseUpload.php b/tests/phpunit/includes/api/ApiTestCaseUpload.php index b6ae641566..f15da2ee91 100644 --- a/tests/phpunit/includes/api/ApiTestCaseUpload.php +++ b/tests/phpunit/includes/api/ApiTestCaseUpload.php @@ -10,10 +10,10 @@ abstract class ApiTestCaseUpload extends ApiTestCase { protected function setUp() { parent::setUp(); - $this->setMwGlobals( array( + $this->setMwGlobals( [ 'wgEnableUploads' => true, 'wgEnableAPI' => true, - ) ); + ] ); $this->clearFakeUploads(); } @@ -27,7 +27,7 @@ abstract class ApiTestCaseUpload extends ApiTestCase { */ public function deleteFileByTitle( $title ) { if ( $title->exists() ) { - $file = wfFindFile( $title, array( 'ignoreRedirect' => true ) ); + $file = wfFindFile( $title, [ 'ignoreRedirect' => true ] ); $noOldArchive = ""; // yes this really needs to be set this way $comment = "removing for test"; $restrictDeletedVersions = false; @@ -111,13 +111,13 @@ abstract class ApiTestCaseUpload extends ApiTestCase { throw new Exception( "couldn't stat $tmpName" ); } - $_FILES[$fieldName] = array( + $_FILES[$fieldName] = [ 'name' => $fileName, 'type' => $type, 'tmp_name' => $tmpName, 'size' => $size, 'error' => null - ); + ]; return true; } @@ -135,19 +135,19 @@ abstract class ApiTestCaseUpload extends ApiTestCase { throw new Exception( "couldn't stat $tmpName" ); } - $_FILES[$fieldName] = array( + $_FILES[$fieldName] = [ 'name' => $fileName, 'type' => $type, 'tmp_name' => $tmpName, 'size' => $size, 'error' => null - ); + ]; } /** * Remove traces of previous fake uploads */ function clearFakeUploads() { - $_FILES = array(); + $_FILES = []; } }