Merge "mediawiki.searchSuggest: Show full article title as a tooltip for each suggestion"
[lhc/web/wiklou.git] / tests / phpunit / includes / api / ApiTestCaseUpload.php
index 7e18b6e..40407dc 100644 (file)
@@ -29,7 +29,10 @@ abstract class ApiTestCaseUpload extends ApiTestCase {
 
        /**
         * Helper function -- remove files and associated articles by Title
-        * @param $title Title: title to be removed
+        *
+        * @param Title $title title to be removed
+        *
+        * @return bool
         */
        public function deleteFileByTitle( $title ) {
                if ( $title->exists() ) {
@@ -37,10 +40,18 @@ abstract class ApiTestCaseUpload extends ApiTestCase {
                        $noOldArchive = ""; // yes this really needs to be set this way
                        $comment = "removing for test";
                        $restrictDeletedVersions = false;
-                       $status = FileDeleteForm::doDelete( $title, $file, $noOldArchive, $comment, $restrictDeletedVersions );
+                       $status = FileDeleteForm::doDelete(
+                               $title,
+                               $file,
+                               $noOldArchive,
+                               $comment,
+                               $restrictDeletedVersions
+                       );
+
                        if ( !$status->isGood() ) {
                                return false;
                        }
+
                        $page = WikiPage::factory( $title );
                        $page->doDeleteArticle( "removing for test" );
 
@@ -53,15 +64,22 @@ abstract class ApiTestCaseUpload extends ApiTestCase {
 
        /**
         * Helper function -- remove files and associated articles with a particular filename
-        * @param $fileName String: filename to be removed
+        *
+        * @param string $fileName filename to be removed
+        *
+        * @return bool
         */
        public function deleteFileByFileName( $fileName ) {
                return $this->deleteFileByTitle( Title::newFromText( $fileName, NS_FILE ) );
        }
 
        /**
-        * Helper function -- given a file on the filesystem, find matching content in the db (and associated articles) and remove them.
-        * @param $filePath String: path to file on the filesystem
+        * Helper function -- given a file on the filesystem, find matching
+        * content in the db (and associated articles) and remove them.
+        *
+        * @param string $filePath path to file on the filesystem
+        *
+        * @return bool
         */
        public function deleteFileByContent( $filePath ) {
                $hash = FSFile::getSha1Base36FromPath( $filePath );
@@ -77,10 +95,14 @@ abstract class ApiTestCaseUpload extends ApiTestCase {
        /**
         * Fake an upload by dumping the file into temp space, and adding info to $_FILES.
         * (This is what PHP would normally do).
-        * @param $fieldName String: name this would have in the upload form
-        * @param $fileName String: name to title this
-        * @param $type String: mime type
-        * @param $filePath String: path where to find file contents
+        *
+        * @param string $fieldName name this would have in the upload form
+        * @param string $fileName name to title this
+        * @param string $type mime type
+        * @param string $filePath path where to find file contents
+        *
+        * @throws Exception
+        * @return bool
         */
        function fakeUploadFile( $fieldName, $fileName, $type, $filePath ) {
                $tmpName = tempnam( wfTempDir(), "" );