From 092cd8ee317d31877bdf87a96d3de240e39c7859 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Thu, 17 Apr 2014 20:43:42 +0200 Subject: [PATCH] Fixed some @params documentation (tests) Swapped some "$var type" to "type $var" or added missing types before the $var. Changed some other types to match the more common spelling. Makes beginning of some text in captial. Also added some missing @param. Change-Id: Ic8aaf0a93796b97d0fa4617c1f86ff59f4b36131 --- tests/parser/ParserTestResult.php | 6 +- tests/parser/parserTest.inc | 85 ++++++++++--------- tests/phpunit/MediaWikiTestCase.php | 13 ++- tests/phpunit/includes/CollationTest.php | 12 +-- tests/phpunit/includes/EditPageTest.php | 10 +-- tests/phpunit/includes/ExternalStoreTest.php | 2 +- tests/phpunit/includes/LinkFilterTest.php | 10 +-- tests/phpunit/includes/SanitizerTest.php | 4 +- tests/phpunit/includes/TitleTest.php | 4 +- tests/phpunit/includes/WikiPageTest.php | 6 +- tests/phpunit/includes/api/ApiTestCase.php | 18 ++-- tests/phpunit/includes/api/ApiTestContext.php | 4 +- .../includes/api/RandomImageGenerator.php | 32 +++---- .../includes/api/format/ApiFormatTestBase.php | 2 +- .../api/query/ApiQueryContinueTestBase.php | 16 ++-- .../includes/api/query/ApiQueryTestBase.php | 2 +- .../includes/changes/RecentChangeTest.php | 12 +-- .../includes/content/ContentHandlerTest.php | 17 ++-- tests/phpunit/includes/db/ORMRowTest.php | 2 +- .../includes/exception/MWExceptionTest.php | 6 +- .../includes/filerepo/StoreBatchTest.php | 14 +-- .../phpunit/includes/json/FormatJsonTest.php | 2 +- .../includes/libs/ProcessCacheLRUTest.php | 4 +- .../includes/media/FormatMetadataTest.php | 4 +- .../media/GIFMetadataExtractorTest.php | 4 +- tests/phpunit/includes/media/GIFTest.php | 20 ++--- tests/phpunit/includes/media/PNGTest.php | 20 ++--- tests/phpunit/includes/media/SVGTest.php | 4 +- tests/phpunit/includes/media/XMPTest.php | 6 +- .../includes/parser/MagicVariableTest.php | 21 +++-- .../includes/parser/MediaWikiParserTest.php | 2 +- .../phpunit/includes/parser/NewParserTest.php | 29 ++++--- .../includes/search/SearchEngineTest.php | 6 +- .../includes/specials/SpecialSearchTest.php | 8 +- .../title/MediaWikiTitleCodecTest.php | 8 +- .../includes/upload/UploadStashTest.php | 2 +- tests/phpunit/languages/LanguageSrTest.php | 16 ++-- tests/phpunit/languages/LanguageUzTest.php | 16 ++-- tests/phpunit/maintenance/DumpTestCase.php | 82 +++++++++--------- tests/phpunit/maintenance/MaintenanceTest.php | 12 +-- .../maintenance/backupPrefetchTest.php | 12 +-- .../maintenance/backupTextPassTest.php | 22 +++-- tests/phpunit/maintenance/backup_LogTest.php | 34 ++++---- tests/phpunit/maintenance/fetchTextTest.php | 16 ++-- .../maintenance/getSlaveServerTest.php | 2 +- tests/phpunit/skins/SideBarTest.php | 6 +- .../phpunit/suites/UploadFromUrlTestSuite.php | 6 +- tests/testHelpers.inc | 11 ++- 48 files changed, 348 insertions(+), 304 deletions(-) diff --git a/tests/parser/ParserTestResult.php b/tests/parser/ParserTestResult.php index 7b0fc4430e..7d9415a2b1 100644 --- a/tests/parser/ParserTestResult.php +++ b/tests/parser/ParserTestResult.php @@ -27,9 +27,9 @@ class ParserTestResult { public $actual; /** - * @param $description string A short text describing the parser test - * usually the text in the parser test .txt file. The description - * is later available using the property $description. + * @param string $description A short text describing the parser test + * usually the text in the parser test .txt file. The description + * is later available using the property $description. */ public function __construct( $description ) { $this->description = $description; diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index e021dcc716..27d6bca3fa 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -80,6 +80,7 @@ class ParserTest { /** * Sets terminal colorization and diff/quick modes depending on OS and * command-line options (--color and --quick). + * @param array $options */ public function __construct( $options = array() ) { # Only colorize output if stdout is a terminal. @@ -299,6 +300,7 @@ class ParserTest { /** * Remove last character if it is a newline * @group utility + * @param string $s */ public static function chomp( $s ) { if ( substr( $s, -1 ) === "\n" ) { @@ -311,6 +313,7 @@ class ParserTest { /** * Run a fuzz test series * Draw input from a set of test files + * @param array $filenames */ function fuzzTest( $filenames ) { $GLOBALS['wgContLang'] = Language::factory( 'en' ); @@ -381,6 +384,7 @@ class ParserTest { /** * Get an input dictionary from a set of parser test files + * @param array $filenames */ function getFuzzInput( $filenames ) { $dict = ''; @@ -444,8 +448,8 @@ class ParserTest { * Prints status updates on stdout and counts up the total * number and percentage of passed tests. * - * @param $filenames Array of strings - * @return Boolean: true if passed all tests, false if any tests failed. + * @param array $filenames Array of strings + * @return bool True if passed all tests, false if any tests failed. */ public function runTestsFromFiles( $filenames ) { $ok = false; @@ -523,12 +527,12 @@ class ParserTest { * and compare the output against the expected results. * Prints status and explanatory messages to stdout. * - * @param $desc String: test's description - * @param $input String: wikitext to try rendering - * @param $result String: result to output - * @param $opts Array: test's options - * @param $config String: overrides for global variables, one per line - * @return Boolean + * @param string $desc Test's description + * @param string $input Wikitext to try rendering + * @param string $result Result to output + * @param array $opts Test's options + * @param string $config Overrides for global variables, one per line + * @return bool */ public function runTest( $desc, $input, $result, $opts, $config ) { if ( $this->showProgress ) { @@ -608,6 +612,7 @@ class ParserTest { /** * Refactored in 1.22 to use ParserTestResult + * @param ParserTestResult $testResult */ function showTestResult( ParserTestResult $testResult ) { if ( $testResult->isSuccess() ) { @@ -621,9 +626,9 @@ class ParserTest { /** * Use a regex to find out the value of an option - * @param $key String: name of option val to retrieve - * @param $opts array: Options array to look in - * @param $default Mixed: default value returned if not found + * @param string $key Name of option val to retrieve + * @param array $opts Options array to look in + * @param mixed $default Default value returned if not found */ private static function getOptionValue( $key, $opts, $default ) { $key = strtolower( $key ); @@ -725,6 +730,8 @@ class ParserTest { /** * Set up the global variables for a consistent environment for each test. * Ideally this should replace the global configuration entirely. + * @param string $opts + * @param string $config */ private function setupGlobals( $opts = '', $config = '' ) { # Find out values for some special options. @@ -1049,7 +1056,7 @@ class ParserTest { * Create a dummy uploads directory which will contain a couple * of files in order to pass existence tests. * - * @return String: the directory + * @return string The directory */ private function setupUploadDir() { global $IP; @@ -1101,6 +1108,7 @@ class ParserTest { /** * Remove the dummy uploads directory + * @param string $dir */ private function teardownUploadDir( $dir ) { if ( $this->keepUploads ) { @@ -1190,7 +1198,7 @@ class ParserTest { /** * Delete the specified files, if they exist. - * @param $files Array: full paths to files to delete. + * @param array $files Full paths to files to delete. */ private static function deleteFiles( $files ) { foreach ( $files as $file ) { @@ -1202,7 +1210,7 @@ class ParserTest { /** * Delete the specified directories, if they exist. Must be empty. - * @param $dirs Array: full paths to directories to delete. + * @param array $dirs Full paths to directories to delete. */ private static function deleteDirs( $dirs ) { foreach ( $dirs as $dir ) { @@ -1214,6 +1222,7 @@ class ParserTest { /** * "Running test $desc..." + * @param string $desc */ protected function showTesting( $desc ) { print "Running test $desc... "; @@ -1224,8 +1233,8 @@ class ParserTest { * * Refactored in 1.22 to use ParserTestResult * - * @param $testResult ParserTestResult - * @return Boolean + * @param ParserTestResult $testResult + * @return bool */ protected function showSuccess( ParserTestResult $testResult ) { if ( $this->showProgress ) { @@ -1241,8 +1250,8 @@ class ParserTest { * * Refactored in 1.22 to use ParserTestResult * - * @param $testResult ParserTestResult - * @return Boolean + * @param ParserTestResult $testResult + * @return bool */ protected function showFailure( ParserTestResult $testResult ) { if ( $this->showFailure ) { @@ -1274,11 +1283,11 @@ class ParserTest { * Run given strings through a diff and return the (colorized) output. * Requires writable /tmp directory and a 'diff' command in the PATH. * - * @param $input String - * @param $output String - * @param $inFileTail String: tailing for the input file name - * @param $outFileTail String: tailing for the output file name - * @return String + * @param string $input + * @param string $output + * @param string $inFileTail Tailing for the input file name + * @param string $outFileTail Tailing for the output file name + * @return string */ protected function quickDiff( $input, $output, $inFileTail = 'expected', $outFileTail = 'actual' @@ -1311,8 +1320,8 @@ class ParserTest { /** * Write the given string to a file, adding a final newline. * - * @param $data String - * @param $filename String + * @param string $data + * @param string $filename */ private function dumpToFile( $data, $filename ) { $file = fopen( $filename, "wt" ); @@ -1324,8 +1333,8 @@ class ParserTest { * Colorize unified diff output if set for ANSI color output. * Subtractions are colored blue, additions red. * - * @param $text String - * @return String + * @param string $text + * @return string */ protected function colorDiff( $text ) { return preg_replace( @@ -1338,7 +1347,7 @@ class ParserTest { /** * Show "Reading tests from ..." * - * @param $path String + * @param string $path */ public function showRunFile( $path ) { print $this->term->color( 1 ) . @@ -1349,10 +1358,10 @@ class ParserTest { /** * Insert a temporary test article - * @param $name String: the title, including any prefix - * @param $text String: the article text - * @param $line Integer: the input line number, for reporting errors - * @param $ignoreDuplicate Boolean: whether to silently ignore duplicate pages + * @param string $name The title, including any prefix + * @param string $text The article text + * @param int $line The input line number, for reporting errors + * @param bool $ignoreDuplicate Whether to silently ignore duplicate pages */ public static function addArticle( $name, $text, $line = 'unknown', $ignoreDuplicate = '' ) { global $wgCapitalLinks; @@ -1390,8 +1399,8 @@ class ParserTest { * application to our scary parser. If the hook is not installed, * abort processing of this file. * - * @param $name String - * @return Bool true if tag hook is present + * @param string $name + * @return bool True if tag hook is present */ public function requireHook( $name ) { global $wgParser; @@ -1413,8 +1422,8 @@ class ParserTest { * application to our scary parser. If the hook is not installed, * abort processing of this file. * - * @param $name String - * @return Bool true if function hook is present + * @param string $name + * @return bool True if function hook is present */ public function requireFunctionHook( $name ) { global $wgParser; @@ -1435,8 +1444,8 @@ class ParserTest { * Run the "tidy" command on text if the $wgUseTidy * global is true * - * @param $text String: the text to tidy - * @return String + * @param string $text The text to tidy + * @return string */ private function tidy( $text ) { global $wgUseTidy; diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 3742a54618..1c21e62d86 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -157,7 +157,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * * @since 1.20 * - * @return string absolute name of the temporary file + * @return string Absolute name of the temporary file */ protected function getNewTempFile() { $fileName = tempnam( wfTempDir(), 'MW_PHPUnit_' . get_class( $this ) . '_' ); @@ -512,7 +512,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * even if using different parameters. * * @param DatabaseBase $db The database connection - * @param String $prefix The prefix to use for the new table set (aka schema). + * @param string $prefix The prefix to use for the new table set (aka schema). * * @throws MWException if the database table prefix is already $prefix */ @@ -599,6 +599,8 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { /** * Used as a compatibility method for phpunit < 3.7.32 + * @param string $value + * @param string $msg */ private function assertEmpty2( $value, $msg ) { return $this->assertTrue( $value == '', $msg ); @@ -660,6 +662,8 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { /** * @since 1.18 + * @param string $offset + * @return mixed */ public function getCliArg( $offset ) { if ( isset( MediaWikiPHPUnitCommand::$additionalOptions[$offset] ) ) { @@ -669,6 +673,8 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { /** * @since 1.18 + * @param string $offset + * @param mixed $value */ public function setCliArg( $offset, $value ) { MediaWikiPHPUnitCommand::$additionalOptions[$offset] = $value; @@ -680,7 +686,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * @since 1.19 * * @param string $function - * @return null */ public function hideDeprecated( $function ) { wfSuppressWarnings(); @@ -1007,6 +1012,8 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * test whenever it is not loaded. * * @since 1.21 + * @param string $extName + * @return bool */ protected function checkPHPExtension( $extName ) { $loaded = extension_loaded( $extName ); diff --git a/tests/phpunit/includes/CollationTest.php b/tests/phpunit/includes/CollationTest.php index 213e610f3a..74b1296766 100644 --- a/tests/phpunit/includes/CollationTest.php +++ b/tests/phpunit/includes/CollationTest.php @@ -20,9 +20,9 @@ class CollationTest extends MediaWikiLangTestCase { * prefix of "XY". Our collation * code makes this assumption. * - * @param $lang String Language code for collator - * @param $base String Base string - * @param $extended String String containing base as a prefix. + * @param string $lang Language code for collator + * @param string $base Base string + * @param string $extended String containing base as a prefix. * * @dataProvider prefixDataProvider */ @@ -81,9 +81,9 @@ class CollationTest extends MediaWikiLangTestCase { /** * Test correct first letter is fetched. * - * @param $collation String Collation name (aka uca-en) - * @param $string String String to get first letter of - * @param $firstLetter String Expected first letter. + * @param string $collation Collation name (aka uca-en) + * @param string $string String to get first letter of + * @param string $firstLetter Expected first letter. * * @dataProvider firstLetterProvider */ diff --git a/tests/phpunit/includes/EditPageTest.php b/tests/phpunit/includes/EditPageTest.php index 0dee6b04c2..4da844809c 100644 --- a/tests/phpunit/includes/EditPageTest.php +++ b/tests/phpunit/includes/EditPageTest.php @@ -67,9 +67,9 @@ class EditPageTest extends MediaWikiLangTestCase { /** * Performs an edit and checks the result. * - * @param String|Title $title The title of the page to edit - * @param String|null $baseText Some text to create the page with before attempting the edit. - * @param User|String|null $user The user to perform the edit as. + * @param string|Title $title The title of the page to edit + * @param string|null $baseText Some text to create the page with before attempting the edit. + * @param User|string|null $user The user to perform the edit as. * @param array $edit An array of request parameters used to define the edit to perform. * Some well known fields are: * * wpTextbox1: the text to submit @@ -82,9 +82,9 @@ class EditPageTest extends MediaWikiLangTestCase { * * wpWatchthis: whether to watch the page * @param int|null $expectedCode The expected result code (EditPage::AS_XXX constants). * Set to null to skip the check. Defaults to EditPage::AS_OK. - * @param String|null $expectedText The text expected to be on the page after the edit. + * @param string|null $expectedText The text expected to be on the page after the edit. * Set to null to skip the check. - * @param String|null $message An optional message to show along with any error message. + * @param string|null $message An optional message to show along with any error message. * * @return WikiPage The page that was just edited, useful for getting the edit's rev_id, etc. */ diff --git a/tests/phpunit/includes/ExternalStoreTest.php b/tests/phpunit/includes/ExternalStoreTest.php index ba155a48e8..cd3364e227 100644 --- a/tests/phpunit/includes/ExternalStoreTest.php +++ b/tests/phpunit/includes/ExternalStoreTest.php @@ -57,7 +57,7 @@ class ExternalStoreFOO { /** * Fetch data from given URL - * @param $url String: an url of the form FOO://cluster/id or FOO://cluster/id/itemid. + * @param string $url An url of the form FOO://cluster/id or FOO://cluster/id/itemid. * @return mixed */ function fetchFromURL( $url ) { diff --git a/tests/phpunit/includes/LinkFilterTest.php b/tests/phpunit/includes/LinkFilterTest.php index 41207b749c..f2c9cb43a2 100644 --- a/tests/phpunit/includes/LinkFilterTest.php +++ b/tests/phpunit/includes/LinkFilterTest.php @@ -34,7 +34,7 @@ class LinkFilterTest extends MediaWikiLangTestCase { * * Takes an array as created by LinkFilter::makeLikeArray() and creates a regex from it * - * @param Array $like Array as created by LinkFilter::makeLikeArray() + * @param array $like Array as created by LinkFilter::makeLikeArray() * @return string Regex */ function createRegexFromLIKE( $like ) { @@ -185,9 +185,9 @@ class LinkFilterTest extends MediaWikiLangTestCase { * * @dataProvider provideValidPatterns * - * @param String $protocol Protocol, e.g. 'http://' or 'mailto:' - * @param String $pattern Search pattern to feed to LinkFilter::makeLikeArray - * @param String $url URL to feed to wfMakeUrlIndexes + * @param string $protocol Protocol, e.g. 'http://' or 'mailto:' + * @param string $pattern Search pattern to feed to LinkFilter::makeLikeArray + * @param string $url URL to feed to wfMakeUrlIndexes * @param bool $shouldBeFound Should the URL be found? (defaults true) */ function testMakeLikeArrayWithValidPatterns( $protocol, $pattern, $url, $shouldBeFound = true ) { @@ -260,7 +260,7 @@ class LinkFilterTest extends MediaWikiLangTestCase { * * @dataProvider provideInvalidPatterns * - * @param $pattern string: Invalid search pattern + * @param string $pattern Invalid search pattern */ function testMakeLikeArrayWithInvalidPatterns( $pattern ) { diff --git a/tests/phpunit/includes/SanitizerTest.php b/tests/phpunit/includes/SanitizerTest.php index 97abf8020a..f5551edf3e 100644 --- a/tests/phpunit/includes/SanitizerTest.php +++ b/tests/phpunit/includes/SanitizerTest.php @@ -91,8 +91,8 @@ class SanitizerTest extends MediaWikiTestCase { * @covers Sanitizer::removeHTMLtags * @dataProvider provideHtml5Tags * - * @param String $tag Name of an HTML5 element (ie: 'video') - * @param Boolean $escaped Wheter sanitizer let the tag in or escape it (ie: '<video>') + * @param string $tag Name of an HTML5 element (ie: 'video') + * @param bool $escaped Whether sanitizer let the tag in or escape it (ie: '<video>') */ public function testRemovehtmltagsOnHtml5Tags( $tag, $escaped ) { $this->setMwGlobals( array( diff --git a/tests/phpunit/includes/TitleTest.php b/tests/phpunit/includes/TitleTest.php index 809382488d..118cf95753 100644 --- a/tests/phpunit/includes/TitleTest.php +++ b/tests/phpunit/includes/TitleTest.php @@ -580,8 +580,8 @@ class TitleTest extends MediaWikiTestCase { /** * @dataProvider provideGetFragment * - * @param $full - * @param $fragment + * @param string $full + * @param string $fragment */ public function testGetFragment( $full, $fragment ) { $title = Title::newFromText( $full ); diff --git a/tests/phpunit/includes/WikiPageTest.php b/tests/phpunit/includes/WikiPageTest.php index 9b41a9c393..9470359f0b 100644 --- a/tests/phpunit/includes/WikiPageTest.php +++ b/tests/phpunit/includes/WikiPageTest.php @@ -56,7 +56,7 @@ class WikiPageTest extends MediaWikiLangTestCase { /** * @param Title $title - * @param String $model + * @param string $model * @return WikiPage */ protected function newPage( $title, $model = null ) { @@ -73,8 +73,8 @@ class WikiPageTest extends MediaWikiLangTestCase { } /** - * @param String|Title|WikiPage $page - * @param String $text + * @param string|Title|WikiPage $page + * @param string $text * @param int $model * * @return WikiPage diff --git a/tests/phpunit/includes/api/ApiTestCase.php b/tests/phpunit/includes/api/ApiTestCase.php index ad297dd935..843c88d0aa 100644 --- a/tests/phpunit/includes/api/ApiTestCase.php +++ b/tests/phpunit/includes/api/ApiTestCase.php @@ -43,11 +43,11 @@ abstract class ApiTestCase extends MediaWikiLangTestCase { /** * Edits or creates a page/revision - * @param $pageName string page title - * @param $text string content of the page - * @param $summary string optional summary string for the revision - * @param $defaultNs int optional namespace id - * @return array as returned by WikiPage::doEditContent() + * @param string $pageName page title + * @param string $text content of the page + * @param string $summary optional summary string for the revision + * @param int $defaultNs optional namespace id + * @return array Array as returned by WikiPage::doEditContent() */ protected function editPage( $pageName, $text, $summary = '', $defaultNs = NS_MAIN ) { $title = Title::newFromText( $pageName, $defaultNs ); @@ -114,10 +114,10 @@ abstract class ApiTestCase extends MediaWikiLangTestCase { * Add an edit token to the API request * This is cheating a bit -- we grab a token in the correct format and then add it to the pseudo-session and to the * request, without actually requesting a "real" edit token - * @param $params Array: key-value API params - * @param $session Array|null: session array - * @param $user User|null A User object for the context - * @return mixed result of the API call + * @param array $params Key-value API params + * @param array|null $session session array + * @param User|null $user A User object for the context + * @return mixed Result of the API call * @throws Exception in case wsToken is not set in the session */ protected function doApiRequestWithToken( array $params, array $session = null, User $user = null ) { diff --git a/tests/phpunit/includes/api/ApiTestContext.php b/tests/phpunit/includes/api/ApiTestContext.php index 80d7ea647a..17dad1fac5 100644 --- a/tests/phpunit/includes/api/ApiTestContext.php +++ b/tests/phpunit/includes/api/ApiTestContext.php @@ -5,8 +5,8 @@ class ApiTestContext extends RequestContext { /** * Returns a DerivativeContext with the request variables in place * - * @param $request WebRequest request object including parameters and session - * @param $user User or null + * @param WebRequest $request WebRequest request object including parameters and session + * @param User|null $user User or null * @return DerivativeContext */ public function newTestContext( WebRequest $request, User $user = null ) { diff --git a/tests/phpunit/includes/api/RandomImageGenerator.php b/tests/phpunit/includes/api/RandomImageGenerator.php index c0612d1122..877e353960 100644 --- a/tests/phpunit/includes/api/RandomImageGenerator.php +++ b/tests/phpunit/includes/api/RandomImageGenerator.php @@ -96,10 +96,10 @@ class RandomImageGenerator { /** * Writes random images with random filenames to disk in the directory you specify, or current working directory * - * @param int $number number of filenames to write - * @param string $format optional, must be understood by ImageMagick, such as 'jpg' or 'gif' - * @param string $dir directory, optional (will default to current working directory) - * @return array filenames we just wrote + * @param int $number Number of filenames to write + * @param string $format Optional, must be understood by ImageMagick, such as 'jpg' or 'gif' + * @param string $dir Directory, optional (will default to current working directory) + * @return array Filenames we just wrote */ function writeImages( $number, $format = 'jpg', $dir = null ) { $filenames = $this->getRandomFilenames( $number, $format, $dir ); @@ -224,9 +224,9 @@ class RandomImageGenerator { * Based on image specification, write a very simple SVG file to disk. * Ignores the background spec because transparency is cool. :) * - * @param array $spec spec describing background and shapes to draw - * @param string $format file format to write (which is obviously always svg here) - * @param string $filename filename to write to + * @param array $spec Spec describing background and shapes to draw + * @param string $format File format to write (which is obviously always svg here) + * @param string $filename Filename to write to * * @throws Exception */ @@ -254,9 +254,9 @@ class RandomImageGenerator { /** * Based on an image specification, write such an image to disk, using Imagick PHP extension - * @param array $spec spec describing background and circles to draw - * @param string $format file format to write - * @param string $filename filename to write to + * @param array $spec Spec describing background and circles to draw + * @param string $format File format to write + * @param string $filename Filename to write to */ public function writeImageWithApi( $spec, $format, $filename ) { // this is a hack because I can't get setImageOrientation() to work. See below. @@ -309,8 +309,8 @@ class RandomImageGenerator { /** * Given an image specification, produce rotated version * This is used when simulating a rotated image capture with Exif orientation - * @param $spec Object returned by getImageSpec - * @param $matrix 2x2 transformation matrix + * @param array $spec Returned by getImageSpec + * @param array $matrix 2x2 transformation matrix * @return array transformed Spec */ private static function rotateImageSpec( &$spec, $matrix ) { @@ -368,10 +368,10 @@ class RandomImageGenerator { * -draw 'fill rgb(99,123,231) circle 59,39 56,57' \ * -draw 'fill rgb(240,12,32) circle 50,21 50,3' filename.png * - * @param array $spec spec describing background and shapes to draw - * @param string $format file format to write (unused by this method but kept so it has the same signature as + * @param array $spec Spec describing background and shapes to draw + * @param string $format File format to write (unused by this method but kept so it has the same signature as * writeImageWithApi) - * @param string $filename filename to write to + * @param string $filename Filename to write to * * @return bool */ @@ -435,7 +435,7 @@ class RandomImageGenerator { * @param int $number_desired number of lines desired * * @throws Exception - * @return array of exactly n elements, drawn randomly from lines the file + * @return array Array of exactly n elements, drawn randomly from lines the file */ private function getRandomLines( $number_desired ) { $filepath = $this->dictionaryFile; diff --git a/tests/phpunit/includes/api/format/ApiFormatTestBase.php b/tests/phpunit/includes/api/format/ApiFormatTestBase.php index 24d8cb8a2b..5f6d53cedd 100644 --- a/tests/phpunit/includes/api/format/ApiFormatTestBase.php +++ b/tests/phpunit/includes/api/format/ApiFormatTestBase.php @@ -5,7 +5,7 @@ abstract class ApiFormatTestBase extends ApiTestCase { /** * @param string $format * @param array $params - * @param $data + * @param array $data * * @return string */ diff --git a/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php b/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php index 1b5a05eae1..f1b773aca2 100644 --- a/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php +++ b/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php @@ -33,6 +33,12 @@ abstract class ApiQueryContinueTestBase extends ApiQueryTestBase { /** * Run query() and compare against expected values + * @param array $expected + * @param array $params Api parameters + * @param int $expectedCount Max number of iterations + * @param string $id Unit test id + * @param bool $useContinue true to use smart continue + * @return mixed Merged results data array */ protected function checkC( $expected, $params, $expectedCount, $id, $continue = true ) { $result = $this->query( $params, $expectedCount, $id, $continue ); @@ -41,11 +47,11 @@ abstract class ApiQueryContinueTestBase extends ApiQueryTestBase { /** * Run query in a loop until no more values are available - * @param array $params api parameters - * @param int $expectedCount max number of iterations - * @param string $id unit test id - * @param boolean $useContinue true to use smart continue - * @return mixed: merged results data array + * @param array $params Api parameters + * @param int $expectedCount Max number of iterations + * @param string $id Unit test id + * @param bool $useContinue true to use smart continue + * @return mixed Merged results data array * @throws Exception */ protected function query( $params, $expectedCount, $id, $useContinue = true ) { diff --git a/tests/phpunit/includes/api/query/ApiQueryTestBase.php b/tests/phpunit/includes/api/query/ApiQueryTestBase.php index a657459d31..1b9c1ce86a 100644 --- a/tests/phpunit/includes/api/query/ApiQueryTestBase.php +++ b/tests/phpunit/includes/api/query/ApiQueryTestBase.php @@ -83,7 +83,7 @@ STR; /** * Checks that the request's result matches the expected results. - * @param $values array is a two element array( request, expected_results ) + * @param array $values Array is a two element array( request, expected_results ) * @throws Exception */ protected function check( $values ) { diff --git a/tests/phpunit/includes/changes/RecentChangeTest.php b/tests/phpunit/includes/changes/RecentChangeTest.php index c63675e9d0..98903f1e46 100644 --- a/tests/phpunit/includes/changes/RecentChangeTest.php +++ b/tests/phpunit/includes/changes/RecentChangeTest.php @@ -253,12 +253,12 @@ class RecentChangeTest extends MediaWikiTestCase { */ /** - * @param $expected String Expected IRC text without colors codes - * @param $type String Log type (move, delete, suppress, patrol ...) - * @param $action String A log type action - * @param $params - * @param $comment String (optional) A comment for the log action - * @param $msg String (optional) A message for PHPUnit :-) + * @param string $expected Expected IRC text without colors codes + * @param string $type Log type (move, delete, suppress, patrol ...) + * @param string $action A log type action + * @param array $params + * @param string $comment (optional) A comment for the log action + * @param string $msg (optional) A message for PHPUnit :-) */ protected function assertIRCComment( $expected, $type, $action, $params, $comment = null, $msg = '' diff --git a/tests/phpunit/includes/content/ContentHandlerTest.php b/tests/phpunit/includes/content/ContentHandlerTest.php index 080ff545fa..f21aad817f 100644 --- a/tests/phpunit/includes/content/ContentHandlerTest.php +++ b/tests/phpunit/includes/content/ContentHandlerTest.php @@ -362,16 +362,16 @@ class DummyContentForTesting extends AbstractContent { } /** - * @return String a string representing the content in a way useful for building a full text search index. - * If no useful representation exists, this method returns an empty string. + * @return string A string representing the content in a way useful for building a full text search index. + * If no useful representation exists, this method returns an empty string. */ public function getTextForSearchIndex() { return ''; } /** - * @return String the wikitext to include when another page includes this content, or false if the content is not - * includable in a wikitext page. + * @return string|bool The wikitext to include when another page includes this content, + * or false if the content is not includable in a wikitext page. */ public function getWikitextForTransclusion() { return false; @@ -429,9 +429,9 @@ class DummyContentForTesting extends AbstractContent { * Returns true if this content is countable as a "real" wiki page, provided * that it's also in a countable location (e.g. a current revision in the main namespace). * - * @param boolean $hasLinks if it is known whether this content contains links, provide this information here, + * @param bool $hasLinks if it is known whether this content contains links, provide this information here, * to avoid redundant parsing to find out. - * @return boolean + * @return bool */ public function isCountable( $hasLinks = null ) { return false; @@ -441,9 +441,8 @@ class DummyContentForTesting extends AbstractContent { * @param Title $title * @param int $revId Unused. * @param null|ParserOptions $options - * @param boolean $generateHtml whether to generate Html (default: true). If false, - * the result of calling getText() on the ParserOutput object returned by - * this method is undefined. + * @param bool $generateHtml whether to generate Html (default: true). If false, the result + * of calling getText() on the ParserOutput object returned by this method is undefined. * * @return ParserOutput */ diff --git a/tests/phpunit/includes/db/ORMRowTest.php b/tests/phpunit/includes/db/ORMRowTest.php index 27d4d0e87f..4ff61655ab 100644 --- a/tests/phpunit/includes/db/ORMRowTest.php +++ b/tests/phpunit/includes/db/ORMRowTest.php @@ -71,7 +71,7 @@ abstract class ORMRowTest extends \MediaWikiTestCase { /** * @since 1.20 * @param array $data - * @param boolean $loadDefaults + * @param bool $loadDefaults * @return IORMRow */ protected function getRowInstance( array $data, $loadDefaults ) { diff --git a/tests/phpunit/includes/exception/MWExceptionTest.php b/tests/phpunit/includes/exception/MWExceptionTest.php index 24741a3dbc..c45de3667b 100644 --- a/tests/phpunit/includes/exception/MWExceptionTest.php +++ b/tests/phpunit/includes/exception/MWExceptionTest.php @@ -167,9 +167,9 @@ class MWExceptionTest extends MediaWikiTestCase { * * @covers MWExceptionHandler::jsonSerializeException * - * @param $expectedKeyType String Type expected as returned by gettype() - * @param $exClass String An exception class (ie: Exception, MWException) - * @param $key String Name of the key to validate in the serialized JSON + * @param string $expectedKeyType Type expected as returned by gettype() + * @param string $exClass An exception class (ie: Exception, MWException) + * @param string $key Name of the key to validate in the serialized JSON * @dataProvider provideJsonSerializedKeys */ public function testJsonserializeexceptionKeys( $expectedKeyType, $exClass, $key ) { diff --git a/tests/phpunit/includes/filerepo/StoreBatchTest.php b/tests/phpunit/includes/filerepo/StoreBatchTest.php index 8fb85b6946..787d83c4fa 100644 --- a/tests/phpunit/includes/filerepo/StoreBatchTest.php +++ b/tests/phpunit/includes/filerepo/StoreBatchTest.php @@ -65,9 +65,9 @@ class StoreBatchTest extends MediaWikiTestCase { /** * Store a file or virtual URL source into a media file name. * - * @param $originalName string The title of the image - * @param $srcPath string The filepath or virtual URL - * @param $flags integer Flags to pass into repo::store(). + * @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 */ private function storeit( $originalName, $srcPath, $flags ) { @@ -85,10 +85,10 @@ class StoreBatchTest extends MediaWikiTestCase { /** * Test storing a file using different flags. * - * @param $fn string The title of the image - * @param $infn string The name of the file (in the filesystem) - * @param $otherfn string The name of the different file (in the filesystem) - * @param $fromrepo bool 'true' if we want to copy from a virtual URL out of the Repo. + * @param string $fn The title of the image + * @param string $infn The name of the file (in the filesystem) + * @param string $otherfn The name of the different file (in the filesystem) + * @param bool $fromrepo 'true' if we want to copy from a virtual URL out of the Repo. */ private function storecohort( $fn, $infn, $otherfn, $fromrepo ) { $f = $this->storeit( $fn, $infn, 0 ); diff --git a/tests/phpunit/includes/json/FormatJsonTest.php b/tests/phpunit/includes/json/FormatJsonTest.php index 307b3551e9..bf58ee3521 100644 --- a/tests/phpunit/includes/json/FormatJsonTest.php +++ b/tests/phpunit/includes/json/FormatJsonTest.php @@ -127,7 +127,7 @@ class FormatJsonTest extends MediaWikiTestCase { * Generate a set of test cases for a particular combination of encoder options. * * @param array $unescapedGroups List of character groups to leave unescaped - * @return array: Arrays of unencoded strings and corresponding encoded strings + * @return array Arrays of unencoded strings and corresponding encoded strings */ private static function getEncodeTestCases( array $unescapedGroups ) { $groups = array( diff --git a/tests/phpunit/includes/libs/ProcessCacheLRUTest.php b/tests/phpunit/includes/libs/ProcessCacheLRUTest.php index 3eae810c4d..1a8a1e5674 100644 --- a/tests/phpunit/includes/libs/ProcessCacheLRUTest.php +++ b/tests/phpunit/includes/libs/ProcessCacheLRUTest.php @@ -114,8 +114,8 @@ class ProcessCacheLRUTest extends MediaWikiTestCase { * delete the older key. * * @dataProvider provideCacheFilling - * @param $cacheMaxEntries Maximum entry the created cache will hold - * @param $entryToFill Number of entries to insert in the created cache. + * @param int $cacheMaxEntries Maximum entry the created cache will hold + * @param int $entryToFill Number of entries to insert in the created cache. */ public function testFillingCache( $cacheMaxEntries, $entryToFill, $msg = '' ) { $cache = new ProcessCacheLRUTestable( $cacheMaxEntries ); diff --git a/tests/phpunit/includes/media/FormatMetadataTest.php b/tests/phpunit/includes/media/FormatMetadataTest.php index 605dfa8c24..a0ab92cb8d 100644 --- a/tests/phpunit/includes/media/FormatMetadataTest.php +++ b/tests/phpunit/includes/media/FormatMetadataTest.php @@ -51,8 +51,8 @@ class FormatMetadataTest extends MediaWikiTestCase { } /** - * @param $filename String - * @param $expected Integer Total image area + * @param string $filename + * @param int $expected Total image area * @dataProvider provideFlattenArray * @covers FormatMetadata::flattenArray */ diff --git a/tests/phpunit/includes/media/GIFMetadataExtractorTest.php b/tests/phpunit/includes/media/GIFMetadataExtractorTest.php index 9e3f9244fc..3491112ed8 100644 --- a/tests/phpunit/includes/media/GIFMetadataExtractorTest.php +++ b/tests/phpunit/includes/media/GIFMetadataExtractorTest.php @@ -9,8 +9,8 @@ class GIFMetadataExtractorTest extends MediaWikiTestCase { /** * Put in a file, and see if the metadata coming out is as expected. - * @param $filename String - * @param $expected Array The extracted metadata. + * @param string $filename + * @param array $expected The extracted metadata. * @dataProvider provideGetMetadata * @covers GIFMetadataExtractor::getMetadata */ diff --git a/tests/phpunit/includes/media/GIFTest.php b/tests/phpunit/includes/media/GIFTest.php index 7bd04b7c90..d7505409de 100644 --- a/tests/phpunit/includes/media/GIFTest.php +++ b/tests/phpunit/includes/media/GIFTest.php @@ -36,8 +36,8 @@ class GIFHandlerTest extends MediaWikiTestCase { } /** - * @param $filename String basename of the file to check - * @param $expected boolean Expected result. + * @param string $filename Basename of the file to check + * @param bool $expected Expected result. * @dataProvider provideIsAnimated * @covers GIFHandler::isAnimatedImage */ @@ -55,8 +55,8 @@ class GIFHandlerTest extends MediaWikiTestCase { } /** - * @param $filename String - * @param $expected Integer Total image area + * @param string $filename + * @param int $expected Total image area * @dataProvider provideGetImageArea * @covers GIFHandler::getImageArea */ @@ -74,8 +74,8 @@ class GIFHandlerTest extends MediaWikiTestCase { } /** - * @param $metadata String Serialized metadata - * @param $expected Integer One of the class constants of GIFHandler + * @param string $metadata Serialized metadata + * @param int $expected One of the class constants of GIFHandler * @dataProvider provideIsMetadataValid * @covers GIFHandler::isMetadataValid */ @@ -95,8 +95,8 @@ class GIFHandlerTest extends MediaWikiTestCase { } /** - * @param $filename String - * @param $expected String Serialized array + * @param string $filename + * @param string $expected Serialized array * @dataProvider provideGetMetadata * @covers GIFHandler::getMetadata */ @@ -114,8 +114,8 @@ class GIFHandlerTest extends MediaWikiTestCase { } /** - * @param $filename String - * @param $expected String Serialized array + * @param string $filename + * @param string $expected Serialized array * @dataProvider provideGetIndependentMetaArray * @covers GIFHandler::getCommonMetaArray */ diff --git a/tests/phpunit/includes/media/PNGTest.php b/tests/phpunit/includes/media/PNGTest.php index a47dc4a5a8..aa73e2d661 100644 --- a/tests/phpunit/includes/media/PNGTest.php +++ b/tests/phpunit/includes/media/PNGTest.php @@ -36,8 +36,8 @@ class PNGHandlerTest extends MediaWikiTestCase { } /** - * @param $filename String basename of the file to check - * @param $expected boolean Expected result. + * @param string $filename basename of the file to check + * @param bool $expected Expected result. * @dataProvider provideIsAnimated * @covers PNGHandler::isAnimatedImage */ @@ -55,8 +55,8 @@ class PNGHandlerTest extends MediaWikiTestCase { } /** - * @param $filename String - * @param $expected Integer Total image area + * @param string $filename + * @param int $expected Total image area * @dataProvider provideGetImageArea * @covers PNGHandler::getImageArea */ @@ -76,8 +76,8 @@ class PNGHandlerTest extends MediaWikiTestCase { } /** - * @param $metadata String Serialized metadata - * @param $expected Integer One of the class constants of PNGHandler + * @param string $metadata Serialized metadata + * @param int $expected One of the class constants of PNGHandler * @dataProvider provideIsMetadataValid * @covers PNGHandler::isMetadataValid */ @@ -97,8 +97,8 @@ class PNGHandlerTest extends MediaWikiTestCase { } /** - * @param $filename String - * @param $expected String Serialized array + * @param string $filename + * @param string $expected Serialized array * @dataProvider provideGetMetadata * @covers PNGHandler::getMetadata */ @@ -117,8 +117,8 @@ class PNGHandlerTest extends MediaWikiTestCase { } /** - * @param $filename String - * @param $expected Array Expected standard metadata + * @param string $filename + * @param array $expected Expected standard metadata * @dataProvider provideGetIndependentMetaArray * @covers PNGHandler::getCommonMetaArray */ diff --git a/tests/phpunit/includes/media/SVGTest.php b/tests/phpunit/includes/media/SVGTest.php index dafcae7de8..97e6c43f91 100644 --- a/tests/phpunit/includes/media/SVGTest.php +++ b/tests/phpunit/includes/media/SVGTest.php @@ -24,8 +24,8 @@ class SvgTest extends MediaWikiTestCase { } /** - * @param $filename String - * @param $expected Array The expected independent metadata + * @param string $filename + * @param array $expected The expected independent metadata * @dataProvider providerGetIndependentMetaArray * @covers SvgHandler::getCommonMetaArray */ diff --git a/tests/phpunit/includes/media/XMPTest.php b/tests/phpunit/includes/media/XMPTest.php index 61ba189dab..25ae1e6032 100644 --- a/tests/phpunit/includes/media/XMPTest.php +++ b/tests/phpunit/includes/media/XMPTest.php @@ -13,9 +13,9 @@ class XMPTest extends MediaWikiTestCase { /** * Put XMP in, compare what comes out... * - * @param $xmp String the actual xml data. - * @param $expected Array expected result of parsing the xmp. - * @param $info String Short sentence on what's being tested. + * @param string $xmp The actual xml data. + * @param array $expected Expected result of parsing the xmp. + * @param string $info Short sentence on what's being tested. * * @throws Exception * @dataProvider provideXMPParse diff --git a/tests/phpunit/includes/parser/MagicVariableTest.php b/tests/phpunit/includes/parser/MagicVariableTest.php index c2c97c0132..2ad2735da8 100644 --- a/tests/phpunit/includes/parser/MagicVariableTest.php +++ b/tests/phpunit/includes/parser/MagicVariableTest.php @@ -54,8 +54,8 @@ class MagicVariableTest extends MediaWikiTestCase { } /** - * @param int $num upper limit for numbers - * @return array of numbers from 1 up to $num + * @param int $num Upper limit for numbers + * @return array Array of numbers from 1 up to $num */ private static function createProviderUpTo( $num ) { $ret = array(); @@ -67,14 +67,14 @@ class MagicVariableTest extends MediaWikiTestCase { } /** - * @return array of months numbers (as an integer) + * @return array Array of months numbers (as an integer) */ public static function provideMonths() { return self::createProviderUpTo( 12 ); } /** - * @return array of days numbers (as an integer) + * @return array Array of days numbers (as an integer) */ public static function provideDays() { return self::createProviderUpTo( 31 ); @@ -187,9 +187,9 @@ class MagicVariableTest extends MediaWikiTestCase { /** * Main assertion helper for magic variables padding - * @param $magic string Magic variable name - * @param $value mixed Month or day - * @param $format string sprintf format for $value + * @param string $magic Magic variable name + * @param mixed $value Month or day + * @param string $format sprintf format for $value */ private function assertMagicPadding( $magic, $value, $format ) { # Initialize parser timestamp as year 2010 at 12h34 56s. @@ -212,7 +212,10 @@ class MagicVariableTest extends MediaWikiTestCase { $this->assertMagic( $expected, $magic ); } - /** helper to set the parser timestamp and revision timestamp */ + /** + * helper to set the parser timestamp and revision timestamp + * @param string $ts + */ private function setParserTS( $ts ) { $this->testParser->Options()->setTimestamp( $ts ); $this->testParser->mRevisionTimestamp = $ts; @@ -220,6 +223,8 @@ class MagicVariableTest extends MediaWikiTestCase { /** * Assertion helper to test a magic variable output + * @param string|int $expected + * @param string $magic */ private function assertMagic( $expected, $magic ) { if ( in_array( $magic, $this->expectedAsInteger ) ) { diff --git a/tests/phpunit/includes/parser/MediaWikiParserTest.php b/tests/phpunit/includes/parser/MediaWikiParserTest.php index c120ca34c6..a506c86269 100644 --- a/tests/phpunit/includes/parser/MediaWikiParserTest.php +++ b/tests/phpunit/includes/parser/MediaWikiParserTest.php @@ -45,7 +45,7 @@ class MediaWikiParserTest { * MediaWikiParserTest::suite( MediaWikiParserTest::WITH_ALL ); * @endcode * - * @param $flags bitwise flag to filter out the $wgParserTestFiles that + * @param int $flags bitwise flag to filter out the $wgParserTestFiles that * will be included. Default: MediaWikiParserTest::CORE_ONLY * * @return PHPUnit_Framework_TestSuite diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php index 234eaf260d..f3c499b58b 100644 --- a/tests/phpunit/includes/parser/NewParserTest.php +++ b/tests/phpunit/includes/parser/NewParserTest.php @@ -400,7 +400,7 @@ class NewParserTest extends MediaWikiTestCase { /** * Get an FS upload directory (only applies to FSFileBackend) * - * @return String: the directory + * @return string The directory */ protected function getUploadDir() { if ( $this->keepUploads ) { @@ -427,7 +427,7 @@ class NewParserTest extends MediaWikiTestCase { * Create a dummy uploads directory which will contain a couple * of files in order to pass existence tests. * - * @return String: the directory + * @return string The directory */ protected function setupUploads() { global $IP; @@ -543,7 +543,7 @@ class NewParserTest extends MediaWikiTestCase { /** * Delete the specified files, if they exist. - * @param $files Array: full paths to files to delete. + * @param array $files Full paths to files to delete. */ private static function deleteFiles( $files ) { $backend = RepoGroup::singleton()->getLocalRepo()->getBackend(); @@ -575,6 +575,7 @@ class NewParserTest extends MediaWikiTestCase { /** * Set the file from whose tests will be run by this instance + * @param string $filename */ public function setParserTestFile( $filename ) { $this->file = $filename; @@ -583,6 +584,11 @@ class NewParserTest extends MediaWikiTestCase { /** * @group medium * @dataProvider parserTestProvider + * @param string $desc + * @param string $input + * @param string $result + * @param array $opts + * @param array $config */ public function testParserTest( $desc, $input, $result, $opts, $config ) { if ( $this->regex != '' && !preg_match( '/' . $this->regex . '/', $desc ) ) { @@ -768,6 +774,7 @@ class NewParserTest extends MediaWikiTestCase { /** * Get an input dictionary from a set of parser test files + * @param array $filenames */ function getFuzzInput( $filenames ) { $dict = ''; @@ -821,6 +828,7 @@ class NewParserTest extends MediaWikiTestCase { /** * Get a Parser object + * @param Preprocessor $preprocessor */ function getParser( $preprocessor = null ) { global $wgParserConf; @@ -855,8 +863,8 @@ class NewParserTest extends MediaWikiTestCase { * application to our scary parser. If the hook is not installed, * abort processing of this file. * - * @param $name String - * @return Bool true if tag hook is present + * @param string $name + * @return bool True if tag hook is present */ public function requireHook( $name ) { global $wgParser; @@ -876,8 +884,8 @@ class NewParserTest extends MediaWikiTestCase { * Run the "tidy" command on text if the $wgUseTidy * global is true * - * @param $text String: the text to tidy - * @return String + * @param string $text The text to tidy + * @return string */ protected function tidy( $text ) { global $wgUseTidy; @@ -891,6 +899,7 @@ class NewParserTest extends MediaWikiTestCase { /** * Remove last character if it is a newline + * @param string $s */ public function removeEndingNewline( $s ) { if ( substr( $s, -1 ) === "\n" ) { @@ -972,9 +981,9 @@ class NewParserTest extends MediaWikiTestCase { /** * Use a regex to find out the value of an option - * @param $key String: name of option val to retrieve - * @param $opts Options array to look in - * @param $default Mixed: default value returned if not found + * @param string $key Name of option val to retrieve + * @param array $opts Options array to look in + * @param mixed $default Default value returned if not found */ protected static function getOptionValue( $key, $opts, $default ) { $key = strtolower( $key ); diff --git a/tests/phpunit/includes/search/SearchEngineTest.php b/tests/phpunit/includes/search/SearchEngineTest.php index ff360e99bb..b0c0f1b5f5 100644 --- a/tests/phpunit/includes/search/SearchEngineTest.php +++ b/tests/phpunit/includes/search/SearchEngineTest.php @@ -100,9 +100,9 @@ class SearchEngineTest extends MediaWikiLangTestCase { /** * Insert a new page * - * @param $pageName String: page name - * @param $text String: page's content - * @param $n Integer: unused + * @param string $pageName Page name + * @param string $text Page's content + * @param int $ns Unused */ protected function insertPage( $pageName, $text, $ns ) { $title = Title::newFromText( $pageName, $ns ); diff --git a/tests/phpunit/includes/specials/SpecialSearchTest.php b/tests/phpunit/includes/specials/SpecialSearchTest.php index 4ccf5d78bb..0fbb0597fa 100644 --- a/tests/phpunit/includes/specials/SpecialSearchTest.php +++ b/tests/phpunit/includes/specials/SpecialSearchTest.php @@ -13,10 +13,10 @@ class SpecialSearchTest extends MediaWikiTestCase { /** * @covers SpecialSearch::load * @dataProvider provideSearchOptionsTests - * @param $requested Array Request parameters. For example array( 'ns5' => true, 'ns6' => true). NULL to use default options. - * @param $userOptions Array User options to test with. For example array('searchNs5' => 1 );. NULL to use default options. - * @param $expectedProfile An expected search profile name - * @param $expectedNs Array Expected namespaces + * @param array $requested Request parameters. For example array( 'ns5' => true, 'ns6' => true). NULL to use default options. + * @param array $userOptions User options to test with. For example array('searchNs5' => 1 );. NULL to use default options. + * @param string $expectedProfile An expected search profile name + * @param array $expectedNs Expected namespaces */ public function testProfileAndNamespaceLoading( $requested, $userOptions, $expectedProfile, $expectedNS, diff --git a/tests/phpunit/includes/title/MediaWikiTitleCodecTest.php b/tests/phpunit/includes/title/MediaWikiTitleCodecTest.php index e4f9396b6f..ac3e41e28b 100644 --- a/tests/phpunit/includes/title/MediaWikiTitleCodecTest.php +++ b/tests/phpunit/includes/title/MediaWikiTitleCodecTest.php @@ -356,10 +356,10 @@ class MediaWikiTitleCodecTest extends MediaWikiTestCase { /** * @dataProvider provideGetNamespaceName * - * @param $namespace - * @param $text - * @param $lang - * @param $expected + * @param int $namespace + * @param string $text + * @param string $lang + * @param string $expected * * @internal param \TitleValue $title */ diff --git a/tests/phpunit/includes/upload/UploadStashTest.php b/tests/phpunit/includes/upload/UploadStashTest.php index da72a9d0c6..fdd40b2a84 100644 --- a/tests/phpunit/includes/upload/UploadStashTest.php +++ b/tests/phpunit/includes/upload/UploadStashTest.php @@ -7,7 +7,7 @@ */ class UploadStashTest extends MediaWikiTestCase { /** - * @var Array of UploadStashTestUser + * @var array Array of UploadStashTestUser */ public static $users; diff --git a/tests/phpunit/languages/LanguageSrTest.php b/tests/phpunit/languages/LanguageSrTest.php index 8d35f36534..bfb199f379 100644 --- a/tests/phpunit/languages/LanguageSrTest.php +++ b/tests/phpunit/languages/LanguageSrTest.php @@ -180,9 +180,9 @@ class LanguageSrTest extends LanguageClassesTestCase { ##### HELPERS ##################################################### /** *Wrapper to verify text stay the same after applying conversion - * @param $text string Text to convert - * @param $variant string Language variant 'sr-ec' or 'sr-el' - * @param $msg string Optional message + * @param string $text Text to convert + * @param string $variant Language variant 'sr-ec' or 'sr-el' + * @param string $msg Optional message */ protected function assertUnConverted( $text, $variant, $msg = '' ) { $this->assertEquals( @@ -194,9 +194,9 @@ class LanguageSrTest extends LanguageClassesTestCase { /** * Wrapper to verify a text is different once converted to a variant. - * @param $text string Text to convert - * @param $variant string Language variant 'sr-ec' or 'sr-el' - * @param $msg string Optional message + * @param string $text Text to convert + * @param string $variant Language variant 'sr-ec' or 'sr-el' + * @param string $msg Optional message */ protected function assertConverted( $text, $variant, $msg = '' ) { $this->assertNotEquals( @@ -210,6 +210,8 @@ class LanguageSrTest extends LanguageClassesTestCase { * Verifiy the given Cyrillic text is not converted when using * using the cyrillic variant and converted to Latin when using * the Latin variant. + * @param string $text Text to convert + * @param string $msg Optional message */ protected function assertCyrillic( $text, $msg = '' ) { $this->assertUnConverted( $text, 'sr-ec', $msg ); @@ -220,6 +222,8 @@ class LanguageSrTest extends LanguageClassesTestCase { * Verifiy the given Latin text is not converted when using * using the Latin variant and converted to Cyrillic when using * the Cyrillic variant. + * @param string $text Text to convert + * @param string $msg Optional message */ protected function assertLatin( $text, $msg = '' ) { $this->assertUnConverted( $text, 'sr-el', $msg ); diff --git a/tests/phpunit/languages/LanguageUzTest.php b/tests/phpunit/languages/LanguageUzTest.php index 8cd3a6a766..4881103ffb 100644 --- a/tests/phpunit/languages/LanguageUzTest.php +++ b/tests/phpunit/languages/LanguageUzTest.php @@ -59,9 +59,9 @@ class LanguageUzTest extends LanguageClassesTestCase { ##### HELPERS ##################################################### /** * Wrapper to verify text stay the same after applying conversion - * @param $text string Text to convert - * @param $variant string Language variant 'uz-cyrl' or 'uz-latn' - * @param $msg string Optional message + * @param string $text Text to convert + * @param string $variant Language variant 'uz-cyrl' or 'uz-latn' + * @param string $msg Optional message */ protected function assertUnConverted( $text, $variant, $msg = '' ) { $this->assertEquals( @@ -73,9 +73,9 @@ class LanguageUzTest extends LanguageClassesTestCase { /** * Wrapper to verify a text is different once converted to a variant. - * @param $text string Text to convert - * @param $variant string Language variant 'uz-cyrl' or 'uz-latn' - * @param $msg string Optional message + * @param string $text Text to convert + * @param string $variant Language variant 'uz-cyrl' or 'uz-latn' + * @param string $msg Optional message */ protected function assertConverted( $text, $variant, $msg = '' ) { $this->assertNotEquals( @@ -89,6 +89,8 @@ class LanguageUzTest extends LanguageClassesTestCase { * Verifiy the given Cyrillic text is not converted when using * using the cyrillic variant and converted to Latin when using * the Latin variant. + * @param string $text Text to convert + * @param string $msg Optional message */ protected function assertCyrillic( $text, $msg = '' ) { $this->assertUnConverted( $text, 'uz-cyrl', $msg ); @@ -99,6 +101,8 @@ class LanguageUzTest extends LanguageClassesTestCase { * Verifiy the given Latin text is not converted when using * using the Latin variant and converted to Cyrillic when using * the Cyrillic variant. + * @param string $text Text to convert + * @param string $msg Optional message */ protected function assertLatin( $text, $msg = '' ) { $this->assertUnConverted( $text, 'uz-latn', $msg ); diff --git a/tests/phpunit/maintenance/DumpTestCase.php b/tests/phpunit/maintenance/DumpTestCase.php index 6950fa3122..7d193f89d4 100644 --- a/tests/phpunit/maintenance/DumpTestCase.php +++ b/tests/phpunit/maintenance/DumpTestCase.php @@ -28,9 +28,9 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { /** * Adds a revision to a page, while returning the resuting revision's id * - * @param $page WikiPage: page to add the revision to - * @param $text string: revisions text - * @param $text string: revisions summare + * @param Page $page Page to add the revision to + * @param string $text Revisions text + * @param string $text Revisions summare * * @throws MWExcepion */ @@ -51,8 +51,8 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { /** * gunzips the given file and stores the result in the original file name * - * @param $fname string: filename to read the gzipped data from and stored - * the gunzipped data into + * @param string $fname Filename to read the gzipped data from and stored + * the gunzipped data into */ protected function gunzip( $fname ) { $gzipped_contents = file_get_contents( $fname ); @@ -112,10 +112,10 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { /** * Step the current XML reader until node end of given name is found. * - * @param $name string: name of the closing element to look for - * (e.g.: "mediawiki" when looking for ) + * @param string $name Name of the closing element to look for + * (e.g.: "mediawiki" when looking for ) * - * @return bool: true if the end node could be found. false otherwise. + * @return bool True if the end node could be found. false otherwise. */ protected function skipToNodeEnd( $name ) { while ( $this->xml->read() ) { @@ -133,11 +133,11 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { * Step the current XML reader to the first element start after the node * end of a given name. * - * @param $name string: name of the closing element to look for - * (e.g.: "mediawiki" when looking for ) + * @param string $name Name of the closing element to look for + * (e.g.: "mediawiki" when looking for ) * - * @return bool: true iff new element after the closing of $name could be - * found. false otherwise. + * @return bool True if new element after the closing of $name could be + * found. false otherwise. */ protected function skipPastNodeEnd( $name ) { $this->assertTrue( $this->skipToNodeEnd( $name ), @@ -154,9 +154,9 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { /** * Opens an XML file to analyze and optionally skips past siteinfo. * - * @param $fname string: name of file to analyze - * @param $skip_siteinfo bool: (optional) If true, step the xml reader - * to the first element after + * @param string $fname Name of file to analyze + * @param bool $skip_siteinfo (optional) If true, step the xml reader + * to the first element after */ protected function assertDumpStart( $fname, $skip_siteinfo = true ) { $this->xml = new XMLReader(); @@ -172,8 +172,8 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { * Asserts that the xml reader is at the final closing tag of an xml file and * closes the reader. * - * @param $tag string: (optional) the name of the final tag - * (e.g.: "mediawiki" for ) + * @param string $tag (optional) the name of the final tag + * (e.g.: "mediawiki" for ) */ protected function assertDumpEnd( $name = "mediawiki" ) { $this->assertNodeEnd( $name, false ); @@ -200,9 +200,9 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { * Asserts that the xml reader is at an element of given name, and optionally * skips past it. * - * @param $name string: the name of the element to check for - * (e.g.: "mediawiki" for ) - * @param $skip bool: (optional) if true, skip past the found element + * @param string $name The name of the element to check for + * (e.g.: "mediawiki" for ) + * @param bool $skip (optional) if true, skip past the found element */ protected function assertNodeStart( $name, $skip = true ) { $this->assertEquals( $name, $this->xml->name, "Node name" ); @@ -216,9 +216,9 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { * Asserts that the xml reader is at an closing element of given name, and optionally * skips past it. * - * @param $name string: the name of the closing element to check for - * (e.g.: "mediawiki" for ) - * @param $skip bool: (optional) if true, skip past the found element + * @param string $name The name of the closing element to check for + * (e.g.: "mediawiki" for ) + * @param bool $skip (optional) if true, skip past the found element */ protected function assertNodeEnd( $name, $skip = true ) { $this->assertEquals( $name, $this->xml->name, "Node name" ); @@ -232,12 +232,12 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { * Asserts that the xml reader is at an element of given tag that contains a given text, * and skips over the element. * - * @param $name string: the name of the element to check for - * (e.g.: "mediawiki" for ...) - * @param $text string|false: If string, check if it equals the elements text. - * If false, ignore the element's text - * @param $skip_ws bool: (optional) if true, skip past white spaces that trail the - * closing element. + * @param string $name The name of the element to check for + * (e.g.: "mediawiki" for ...) + * @param string|false $text If string, check if it equals the elements text. + * If false, ignore the element's text + * @param bool $skip_ws (optional) if true, skip past white spaces that trail the + * closing element. */ protected function assertTextNode( $name, $text, $skip_ws = true ) { $this->assertNodeStart( $name ); @@ -261,9 +261,9 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { * title, ns, and id tags. Hence after this function, the xml reader is at the first * revision of the current page. * - * @param $id int: id of the page to assert - * @param $ns int: number of namespage to assert - * @param $name string: title of the current page + * @param int $id Id of the page to assert + * @param int $ns Number of namespage to assert + * @param string $name Title of the current page */ protected function assertPageStart( $id, $ns, $name ) { @@ -288,16 +288,16 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { * Asserts that the xml reader is at a revision and checks its representation before * skipping over it. * - * @param $id int: id of the revision - * @param $summary string: summary of the revision - * @param $text_id int: id of the revision's text - * @param $text_bytes int: # of bytes in the revision's text - * @param $text_sha1 string: the base36 SHA-1 of the revision's text - * @param $text string|false: (optional) The revision's string, or false to check for a + * @param int $id Id of the revision + * @param string $summary Summary of the revision + * @param int $text_id Id of the revision's text + * @param int $text_bytes Number of bytes in the revision's text + * @param string $text_sha1 The base36 SHA-1 of the revision's text + * @param string|bool $text (optional) The revision's string, or false to check for a * revision stub - * @param $model String: the expected content model id (default: CONTENT_MODEL_WIKITEXT) - * @param $format String: the expected format model id (default: CONTENT_FORMAT_WIKITEXT) - * @param $parentid int|false: (optional) id of the parent revision + * @param string $model The expected content model id (default: CONTENT_MODEL_WIKITEXT) + * @param string $format The expected format model id (default: CONTENT_FORMAT_WIKITEXT) + * @param int|bool $parentid (optional) id of the parent revision */ protected function assertRevision( $id, $summary, $text_id, $text_bytes, $text_sha1, $text = false, $parentid = false, $model = CONTENT_MODEL_WIKITEXT, $format = CONTENT_FORMAT_WIKITEXT diff --git a/tests/phpunit/maintenance/MaintenanceTest.php b/tests/phpunit/maintenance/MaintenanceTest.php index 2a5bd5f9e8..42d1d0bfd7 100644 --- a/tests/phpunit/maintenance/MaintenanceTest.php +++ b/tests/phpunit/maintenance/MaintenanceTest.php @@ -158,12 +158,12 @@ class MaintenanceTest extends MediaWikiTestCase { * * This function simulates shutdown of self::m. * - * @param $preShutdownOutput string: expected output before simulating shutdown - * @param $expectNLAppending bool: Whether or not shutdown simulation is expected - * to add a newline to the output. If false, $preShutdownOutput is the - * expected output after shutdown simulation. Otherwise, - * $preShutdownOutput with an appended newline is the expected output - * after shutdown simulation. + * @param string $preShutdownOutput Expected output before simulating shutdown + * @param bool $expectNLAppending Whether or not shutdown simulation is expected + * to add a newline to the output. If false, $preShutdownOutput is the + * expected output after shutdown simulation. Otherwise, + * $preShutdownOutput with an appended newline is the expected output + * after shutdown simulation. */ private function assertOutputPrePostShutdown( $preShutdownOutput, $expectNLAppending ) { diff --git a/tests/phpunit/maintenance/backupPrefetchTest.php b/tests/phpunit/maintenance/backupPrefetchTest.php index adf026cae6..904f12f869 100644 --- a/tests/phpunit/maintenance/backupPrefetchTest.php +++ b/tests/phpunit/maintenance/backupPrefetchTest.php @@ -30,9 +30,9 @@ class BaseDumpTest extends MediaWikiTestCase { /** * asserts that a prefetch yields an expected string * - * @param $expected string|null: the exepcted result of the prefetch - * @param $page int: the page number to prefetch the text for - * @param $revision int: the revision number to prefetch the text for + * @param string|null $expected The exepcted result of the prefetch + * @param int $page The page number to prefetch the text for + * @param int $revision The revision number to prefetch the text for */ private function assertPrefetchEquals( $expected, $page, $revision ) { $this->assertEquals( $expected, $this->dump->prefetch( $page, $revision ), @@ -142,9 +142,9 @@ class BaseDumpTest extends MediaWikiTestCase { * * The temporary file is removed by DumpBackup upon tearDown. * - * @param $requested_pages Array The indices of the page parts that should - * go into the prefetch file. 1,2,4 are available. - * @return String The file name of the created temporary file + * @param array $requested_pages The indices of the page parts that should + * go into the prefetch file. 1,2,4 are available. + * @return string The file name of the created temporary file */ private function setUpPrefetch( $requested_pages = array( 1, 2, 4 ) ) { // The file name, where we store the prepared prefetch file diff --git a/tests/phpunit/maintenance/backupTextPassTest.php b/tests/phpunit/maintenance/backupTextPassTest.php index 8a297b1d56..a7630713f5 100644 --- a/tests/phpunit/maintenance/backupTextPassTest.php +++ b/tests/phpunit/maintenance/backupTextPassTest.php @@ -219,8 +219,8 @@ class TextPassDumperTest extends DumpTestCase { * Ensures that checkpoint dumps are used and written, by successively increasing the * stub size and dumping until the duration crosses a threshold. * - * @param $checkpointFormat string: Either "file" for plain text or "gzip" for gzipped - * checkpoint files. + * @param string $checkpointFormat Either "file" for plain text or "gzip" for gzipped + * checkpoint files. */ private function checkpointHelper( $checkpointFormat = "file" ) { // Getting temporary names @@ -421,16 +421,14 @@ class TextPassDumperTest extends DumpTestCase { /** * Creates a stub file that is used for testing the text pass of dumps * - * @param $fname string: (Optional) Absolute name of the file to write - * the stub into. If this parameter is null, a new temporary - * file is generated that is automatically removed upon - * tearDown. - * @param $iterations integer: (Optional) specifies how often the block - * of 3 pages should go into the stub file. The page and - * revision id increase further and further, while the text - * id of the first iteration is reused. The pages and revision - * of iteration > 1 have no corresponding representation in the - * database. + * @param string $fname (Optional) Absolute name of the file to write + * the stub into. If this parameter is null, a new temporary + * file is generated that is automatically removed upon tearDown. + * @param int $iterations (Optional) specifies how often the block + * of 3 pages should go into the stub file. The page and + * revision id increase further and further, while the text + * id of the first iteration is reused. The pages and revision + * of iteration > 1 have no corresponding representation in the database. * @return string absolute filename of the stub */ private function setUpStub( $fname = null, $iterations = 1 ) { diff --git a/tests/phpunit/maintenance/backup_LogTest.php b/tests/phpunit/maintenance/backup_LogTest.php index 5640b8d724..7ca45960c5 100644 --- a/tests/phpunit/maintenance/backup_LogTest.php +++ b/tests/phpunit/maintenance/backup_LogTest.php @@ -16,16 +16,15 @@ class BackupDumperLoggerTest extends DumpTestCase { /** * adds a log entry to the database. * - * @param $type string: type of the log entry - * @param $subtype string: subtype of the log entry - * @param $user User: user that performs the logged operation - * @param $ns int: number of the namespace for the entry's target's title - * @param $title string: title of the entry's target - * @param $comment string: comment of the log entry - * @param $parameters Array: (optional) accompanying data that is attached - * to the entry + * @param string $type Type of the log entry + * @param string $subtype Subtype of the log entry + * @param User $user User that performs the logged operation + * @param int $ns Number of the namespace for the entry's target's title + * @param string $title Title of the entry's target + * @param string $comment Comment of the log entry + * @param array $parameters (optional) accompanying data that is attached to the entry * - * @return int id of the added log entry + * @return int Id of the added log entry */ private function addLogEntry( $type, $subtype, User $user, $ns, $title, $comment = null, $parameters = null @@ -88,15 +87,14 @@ class BackupDumperLoggerTest extends DumpTestCase { * asserts that the xml reader is at the beginning of a log entry and skips over * it while analyzing it. * - * @param $id int: id of the log entry - * @param $user_name string: user name of the log entry's performer - * @param $user_id int: user id of the log entry 's performer - * @param $comment string|null: comment of the log entry. If null, the comment - * text is ignored. - * @param $type string: type of the log entry - * @param $subtype string: subtype of the log entry - * @param $title string: title of the log entry's target - * @param $parameters array: (optional) unserialized data accompanying the log entry + * @param int $id Id of the log entry + * @param string $user_name User name of the log entry's performer + * @param int $user_id User id of the log entry 's performer + * @param string|null $comment Comment of the log entry. If null, the comment text is ignored. + * @param string $type Type of the log entry + * @param string $subtype Subtype of the log entry + * @param string $title Title of the log entry's target + * @param array $parameters (optional) unserialized data accompanying the log entry */ private function assertLogItem( $id, $user_name, $user_id, $comment, $type, $subtype, $title, $parameters = array() diff --git a/tests/phpunit/maintenance/fetchTextTest.php b/tests/phpunit/maintenance/fetchTextTest.php index dd80840db8..2e47e0c2cd 100644 --- a/tests/phpunit/maintenance/fetchTextTest.php +++ b/tests/phpunit/maintenance/fetchTextTest.php @@ -11,7 +11,7 @@ require_once __DIR__ . "/../../../maintenance/fetchText.php"; class SemiMockedFetchText extends FetchText { /** - * @var String|null Text to pass as stdin + * @var string|null Text to pass as stdin */ private $mockStdinText = null; @@ -21,14 +21,14 @@ class SemiMockedFetchText extends FetchText { private $mockSetUp = false; /** - * @var Array Invocation counters for the mocked aspects + * @var array Invocation counters for the mocked aspects */ private $mockInvocations = array( 'getStdin' => 0 ); /** * Data for the fake stdin * - * @param $stdin String The string to be used instead of stdin + * @param string $stdin The string to be used instead of stdin */ function mockStdin( $stdin ) { $this->mockStdinText = $stdin; @@ -38,7 +38,7 @@ class SemiMockedFetchText extends FetchText { /** * Gets invocation counters for mocked methods. * - * @return Array An array, whose keys are function names. The corresponding values + * @return array An array, whose keys are function names. The corresponding values * denote the number of times the function has been invoked. */ function mockGetInvocations() { @@ -98,9 +98,9 @@ class FetchTextTest extends MediaWikiTestCase { /** * Adds a revision to a page, while returning the resuting text's id * - * @param $page WikiPage The page to add the revision to - * @param $text String The revisions text - * @param $text String The revisions summare + * @param WikiPage $page The page to add the revision to + * @param string $text The revisions text + * @param string $text The revisions summare * * @throws MWExcepion */ @@ -155,6 +155,8 @@ class FetchTextTest extends MediaWikiTestCase { /** * Helper to relate FetchText's input and output + * @param string $input + * @param string $expectedOutput */ private function assertFilter( $input, $expectedOutput ) { $this->fetchText->mockStdin( $input ); diff --git a/tests/phpunit/maintenance/getSlaveServerTest.php b/tests/phpunit/maintenance/getSlaveServerTest.php index bb678af464..165dc55158 100644 --- a/tests/phpunit/maintenance/getSlaveServerTest.php +++ b/tests/phpunit/maintenance/getSlaveServerTest.php @@ -16,7 +16,7 @@ class GetSlaveServerTest extends MediaWikiTestCase { * It matches IPs or hostnames, both optionally followed by a * port specification * - * @return String the regular expression + * @return string The regular expression */ private function getServerRE() { if ( $this->db->getType() === 'sqlite' ) { diff --git a/tests/phpunit/skins/SideBarTest.php b/tests/phpunit/skins/SideBarTest.php index 3fb487c0d8..a3122b9446 100644 --- a/tests/phpunit/skins/SideBarTest.php +++ b/tests/phpunit/skins/SideBarTest.php @@ -48,9 +48,9 @@ class SideBarTest extends MediaWikiLangTestCase { /** * Internal helper to test the sidebar - * @param $expected - * @param $text - * @param $message (Default: '') + * @param array $expected + * @param string $text + * @param string $message (Default: '') * @todo this assert method to should be converted to a test using a dataprovider.. */ private function assertSideBar( $expected, $text, $message = '' ) { diff --git a/tests/phpunit/suites/UploadFromUrlTestSuite.php b/tests/phpunit/suites/UploadFromUrlTestSuite.php index fb7780d0ec..4bc29cd294 100644 --- a/tests/phpunit/suites/UploadFromUrlTestSuite.php +++ b/tests/phpunit/suites/UploadFromUrlTestSuite.php @@ -137,7 +137,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite { /** * Delete the specified files, if they exist. * - * @param $files Array: full paths to files to delete. + * @param array $files Full paths to files to delete. */ private static function deleteFiles( $files ) { foreach ( $files as $file ) { @@ -150,7 +150,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite { /** * Delete the specified directories, if they exist. Must be empty. * - * @param $dirs Array: full paths to directories to delete. + * @param array $dirs Full paths to directories to delete. */ private static function deleteDirs( $dirs ) { foreach ( $dirs as $dir ) { @@ -164,7 +164,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite { * Create a dummy uploads directory which will contain a couple * of files in order to pass existence tests. * - * @return String: the directory + * @return string The directory */ private function setupUploadDir() { global $IP; diff --git a/tests/testHelpers.inc b/tests/testHelpers.inc index bc6714757b..6ff2b24643 100644 --- a/tests/testHelpers.inc +++ b/tests/testHelpers.inc @@ -333,8 +333,8 @@ class DbTestRecorder extends DbTestPreviewer { /** * Record an individual test item's success or failure to the db * - * @param $test String - * @param $result Boolean + * @param string $test + * @param bool $result */ function record( $test, $result ) { parent::record( $test, $result ); @@ -545,9 +545,9 @@ class TestFileIterator implements Iterator { * Throw an exception if it is not set, referencing current section * and adding the current file name and line number * - * @param $token String|Array: expected token(s) that should have been + * @param string|array $token Expected token(s) that should have been * mentioned before closing this section - * @param $fatal Boolean: true iff an exception should be thrown if + * @param bool $fatal True iff an exception should be thrown if * the section is not found. */ private function checkSection( $tokens, $fatal = true ) { @@ -618,6 +618,7 @@ class DelayedParserTest { /** * Called whenever we actually want to run the hook. * Should be the case if we found the parserTest is not disabled + * @param ParserTest|NewParserTest $parserTest */ public function unleash( &$parserTest ) { if ( !( $parserTest instanceof ParserTest || $parserTest instanceof NewParserTest ) ) { @@ -647,6 +648,7 @@ class DelayedParserTest { /** * Similar to ParserTest object but does not run anything * Use unleash() to really execute the hook + * @param string $hook */ public function requireHook( $hook ) { $this->hooks[] = $hook; @@ -655,6 +657,7 @@ class DelayedParserTest { /** * Similar to ParserTest object but does not run anything * Use unleash() to really execute the hook function + * @param string $fnHook */ public function requireFunctionHook( $fnHook ) { $this->fnHooks[] = $fnHook; -- 2.20.1