Merge "Remove unused global from SpecialUserlogin.php"
[lhc/web/wiklou.git] / tests / phpunit / includes / api / ApiUploadTest.php
index b4b1bf3..b7f7d10 100644 (file)
@@ -1,29 +1,24 @@
 <?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 {
        /**
@@ -456,9 +451,9 @@ 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" );
@@ -466,9 +461,9 @@ class ApiUploadTest extends ApiTestCaseUpload {
 
                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 );