<?php
-/**
- * @group API
- * @group Database
- * @group medium
- */
-
/**
* n.b. Ensure that you can write to the images/ directory as the
* user that will run tests.
- */
-
-// Note for reviewers: this intentionally duplicates functionality already in
-// "ApiSetup" and so on. This framework works better IMO and has less
-// strangeness (such as test cases inheriting from "ApiSetup"...) (and in the
-// case of the other Upload tests, this flat out just actually works... )
-
-// @todo Port the other Upload tests, and other API tests to this framework
-
-/**
- * @group Database
- * @group Broken
- * Broken test, reports false errors from time to time.
+ *
+ * Note for reviewers: this intentionally duplicates functionality already in
+ * "ApiSetup" and so on. This framework works better IMO and has less
+ * strangeness (such as test cases inheriting from "ApiSetup"...) (and in the
+ * case of the other Upload tests, this flat out just actually works... )
+ *
+ * @todo Port the other Upload tests, and other API tests to this framework
+ *
+ * @todo Broken test, reports false errors from time to time.
* See https://bugzilla.wikimedia.org/26169
*
- * This is pretty sucky... needs to be prettified.
+ * @todo This is pretty sucky... needs to be prettified.
+ *
+ * @group API
+ * @group Database
+ * @group medium
+ * @group Broken
*/
class ApiUploadTest extends ApiTestCaseUpload {
/**
$chunkSessionKey = false;
$resultOffset = 0;
// Open the file:
- wfSuppressWarnings();
+ MediaWiki\suppressWarnings();
$handle = fopen( $filePath, "r" );
- wfRestoreWarnings();
+ MediaWiki\restoreWarnings();
if ( $handle === false ) {
$this->markTestIncomplete( "could not open file: $filePath" );
while ( !feof( $handle ) ) {
// Get the current chunk
- wfSuppressWarnings();
+ MediaWiki\suppressWarnings();
$chunkData = fread( $handle, $chunkSize );
- wfRestoreWarnings();
+ MediaWiki\restoreWarnings();
// Upload the current chunk into the $_FILE object:
$this->fakeUploadChunk( 'chunk', 'blob', $mimeType, $chunkData );