From: umherirrender Date: Thu, 24 Jul 2014 12:55:43 +0000 (+0200) Subject: Cleanup some docs (tests) X-Git-Tag: 1.31.0-rc.0~14477^2 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=26837cd280530c274978397eacdb3967034466c1;p=lhc%2Fweb%2Fwiklou.git Cleanup some docs (tests) - Swap "$variable type" to "type $variable" - Fixed spacing inside docs - Makes beginning of @param/@var/@throws in capital - Changed some types to match the more common spelling Change-Id: Ia041964250d8b7c0349d79dc9b131c5b8696e795 --- diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 70cc8deaa3..1fbc7a2a63 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -331,7 +331,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * * @param array|string $globalKeys Key to the global variable, or an array of keys. * - * @throws Exception when trying to stash an unset global + * @throws Exception When trying to stash an unset global * @since 1.23 */ protected function stashMwGlobals( $globalKeys ) { @@ -370,7 +370,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * @param string $name The name of the global, as in wgFooBar * @param array $values The array containing the entries to set in that global * - * @throws MWException if the designated global is not an array. + * @throws MWException If the designated global is not an array. * * @since 1.21 */ @@ -516,7 +516,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * @param DatabaseBase $db The database connection * @param string $prefix The prefix to use for the new table set (aka schema). * - * @throws MWException if the database table prefix is already $prefix + * @throws MWException If the database table prefix is already $prefix */ public static function setupTestDB( DatabaseBase $db, $prefix ) { global $wgDBprefix; diff --git a/tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php b/tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php index 05155dbd53..1faad52a71 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php @@ -2,7 +2,7 @@ /** * @group GlobalFunctions - *@covers ::wfRemoveDotSegments + * @covers ::wfRemoveDotSegments */ class WfRemoveDotSegmentsTest extends MediaWikiTestCase { /** diff --git a/tests/phpunit/includes/HtmlFormatterTest.php b/tests/phpunit/includes/HtmlFormatterTest.php index ae5c9c4362..9dbfa452c8 100644 --- a/tests/phpunit/includes/HtmlFormatterTest.php +++ b/tests/phpunit/includes/HtmlFormatterTest.php @@ -8,7 +8,7 @@ class HtmlFormatterTest extends MediaWikiTestCase { * @dataProvider getHtmlData * * @param string $input - * @param $expectedText + * @param string $expectedText * @param array $expectedRemoved * @param callable|bool $callback */ diff --git a/tests/phpunit/includes/ImagePage404Test.php b/tests/phpunit/includes/ImagePage404Test.php index 3660456902..197a2b32e0 100644 --- a/tests/phpunit/includes/ImagePage404Test.php +++ b/tests/phpunit/includes/ImagePage404Test.php @@ -29,8 +29,8 @@ class ImagePage404Test extends MediaWikiMediaTestCase { /** * @dataProvider providerGetThumbSizes - * @param $filename String - * @param $expectedNumberThumbs integer How many thumbnails to show + * @param string $filename + * @param int $expectedNumberThumbs How many thumbnails to show */ function testGetThumbSizes( $filename, $expectedNumberThumbs ) { $iPage = $this->getImagePage( $filename ); diff --git a/tests/phpunit/includes/ImagePageTest.php b/tests/phpunit/includes/ImagePageTest.php index d5ecb9570d..0272c5461b 100644 --- a/tests/phpunit/includes/ImagePageTest.php +++ b/tests/phpunit/includes/ImagePageTest.php @@ -22,8 +22,8 @@ class ImagePageTest extends MediaWikiMediaTestCase { /** * @dataProvider providerGetDisplayWidthHeight - * @param $dimensions Array [maxWidth, maxHeight, width, height] - * @param $expected Array [width, height] The width and height we expect to display at + * @param array $dimensions Array [maxWidth, maxHeight, width, height] + * @param array $expected Array [width, height] The width and height we expect to display at */ function testGetDisplayWidthHeight( $dim, $expected ) { $iPage = $this->getImagePage( 'animated.gif' ); @@ -66,8 +66,8 @@ class ImagePageTest extends MediaWikiMediaTestCase { /** * @dataProvider providerGetThumbSizes - * @param $filename String - * @param $expectedNumberThumbs integer How many thumbnails to show + * @param string $filename + * @param int $expectedNumberThumbs How many thumbnails to show */ function testGetThumbSizes( $filename, $expectedNumberThumbs ) { $iPage = $this->getImagePage( $filename ); diff --git a/tests/phpunit/includes/MimeMagicTest.php b/tests/phpunit/includes/MimeMagicTest.php index 19746a99eb..742d38277a 100644 --- a/tests/phpunit/includes/MimeMagicTest.php +++ b/tests/phpunit/includes/MimeMagicTest.php @@ -11,9 +11,9 @@ class MimeMagicTest extends MediaWikiTestCase { /** * @dataProvider providerImproveTypeFromExtension - * @param $ext String File extension (no leading dot) - * @param $oldMime String Initially detected MIME - * @param $expectedMime String MIME type after taking extension into account + * @param string $ext File extension (no leading dot) + * @param string $oldMime Initially detected MIME + * @param string $expectedMime MIME type after taking extension into account */ function testImproveTypeFromExtension( $ext, $oldMime, $expectedMime ) { $actualMime = $this->mimeMagic->improveTypeFromExtension( $oldMime, $ext ); diff --git a/tests/phpunit/includes/OutputPageTest.php b/tests/phpunit/includes/OutputPageTest.php index e866386244..96f1c63914 100644 --- a/tests/phpunit/includes/OutputPageTest.php +++ b/tests/phpunit/includes/OutputPageTest.php @@ -25,7 +25,7 @@ class OutputPageTest extends MediaWikiTestCase { * options['expectedReturn'] - expected return value * options['message'] - PHPUnit message for assertion * - * @param array $args key-value array of arguments as shown above + * @param array $args Key-value array of arguments as shown above */ protected function assertTransformCssMediaCase( $args ) { $queryData = array(); diff --git a/tests/phpunit/includes/StatusTest.php b/tests/phpunit/includes/StatusTest.php index b2e44593be..11f867a2ca 100644 --- a/tests/phpunit/includes/StatusTest.php +++ b/tests/phpunit/includes/StatusTest.php @@ -203,7 +203,7 @@ class StatusTest extends MediaWikiLangTestCase { } /** - * @param array $messageDetails eg. array( 'KEY' => array(/PARAMS/) ) + * @param array $messageDetails E.g. array( 'KEY' => array(/PARAMS/) ) * @return Message[] */ protected function getMockMessages( $messageDetails ) { diff --git a/tests/phpunit/includes/api/ApiMainTest.php b/tests/phpunit/includes/api/ApiMainTest.php index 8c5f5400e8..780cf9ed1f 100644 --- a/tests/phpunit/includes/api/ApiMainTest.php +++ b/tests/phpunit/includes/api/ApiMainTest.php @@ -55,7 +55,7 @@ class ApiMainTest extends ApiTestCase { * @dataProvider provideAssert * @param User $user * @param string $assert - * @param string|bool $error false if no error expected + * @param string|bool $error False if no error expected */ public function testAssert( $user, $assert, $error ) { try { diff --git a/tests/phpunit/includes/api/ApiTestCase.php b/tests/phpunit/includes/api/ApiTestCase.php index 0976b1a9bb..b556ef80f2 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 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() + * @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 as returned by WikiPage::doEditContent() */ protected function editPage( $pageName, $text, $summary = '', $defaultNs = NS_MAIN ) { $title = Title::newFromText( $pageName, $defaultNs ); @@ -119,10 +119,10 @@ abstract class ApiTestCase extends MediaWikiLangTestCase { * requesting a "real" edit token. * * @param array $params Key-value API params - * @param array|null $session session array + * @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 + * @return 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/ApiTestCaseUpload.php b/tests/phpunit/includes/api/ApiTestCaseUpload.php index 837becc641..7e513394e4 100644 --- a/tests/phpunit/includes/api/ApiTestCaseUpload.php +++ b/tests/phpunit/includes/api/ApiTestCaseUpload.php @@ -30,7 +30,7 @@ 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 */ @@ -65,7 +65,7 @@ abstract class ApiTestCaseUpload extends ApiTestCase { /** * Helper function -- remove files and associated articles with a particular filename * - * @param string $fileName filename to be removed + * @param string $fileName Filename to be removed * * @return bool */ @@ -77,7 +77,7 @@ abstract class ApiTestCaseUpload extends ApiTestCase { * 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 + * @param string $filePath Path to file on the filesystem * * @return bool */ @@ -96,10 +96,10 @@ 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 string $fieldName name this would have in the upload form - * @param string $fileName name to title this + * @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 + * @param string $filePath Path where to find file contents * * @throws Exception * @return bool diff --git a/tests/phpunit/includes/api/RandomImageGenerator.php b/tests/phpunit/includes/api/RandomImageGenerator.php index e3eea4cb3c..328ea8e22f 100644 --- a/tests/phpunit/includes/api/RandomImageGenerator.php +++ b/tests/phpunit/includes/api/RandomImageGenerator.php @@ -365,9 +365,9 @@ class RandomImageGenerator { /** * Given a matrix and a pair of images, return new position * @param array $matrix 2x2 rotation matrix - * @param int $x x-coordinate number - * @param int $y y-coordinate number - * @return array Transformed with properties x, y + * @param int $x The x-coordinate number + * @param int $y The y-coordinate number + * @return Transformed with properties x, y */ private static function matrixMultiply2x2( $matrix, $x, $y ) { return array( @@ -451,10 +451,10 @@ class RandomImageGenerator { * * Will throw exception if the file could not be read or if it had fewer lines than requested. * - * @param int $number_desired number of lines desired + * @param int $number_desired Number of lines desired * * @throws Exception - * @return array Array of exactly n elements, drawn randomly from lines the file + * @return 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/query/ApiQueryContinueTestBase.php b/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php index bd15f044a3..6f4479b74f 100644 --- a/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php +++ b/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php @@ -37,8 +37,8 @@ abstract class ApiQueryContinueTestBase extends ApiQueryTestBase { * @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 + * @param bool $useContinue True to use smart continue + * @return Merged results data array */ protected function checkC( $expected, $params, $expectedCount, $id, $continue = true ) { $result = $this->query( $params, $expectedCount, $id, $continue ); @@ -50,8 +50,8 @@ abstract class ApiQueryContinueTestBase extends ApiQueryTestBase { * @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 + * @param bool $useContinue True to use smart continue + * @return 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 1b9c1ce86a..f920ce9ce7 100644 --- a/tests/phpunit/includes/api/query/ApiQueryTestBase.php +++ b/tests/phpunit/includes/api/query/ApiQueryTestBase.php @@ -34,7 +34,7 @@ STR; /** * Merges all requests parameter + expected values into one - * @param ... list of arrays, each of which contains exactly two + * @param array $v,... List of arrays, each of which contains exactly two * @return array */ protected function merge( /*...*/ ) { diff --git a/tests/phpunit/includes/cache/MessageCacheTest.php b/tests/phpunit/includes/cache/MessageCacheTest.php index 803acf7362..442e9f9f66 100644 --- a/tests/phpunit/includes/cache/MessageCacheTest.php +++ b/tests/phpunit/includes/cache/MessageCacheTest.php @@ -59,7 +59,7 @@ class MessageCacheTest extends MediaWikiLangTestCase { * Helper function for addDBData -- adds a simple page to the database * * @param string $title Title of page to be created - * @param string $lang Language and content of the created page + * @param string $lang Language and content of the created page * @param string|null $content Content of the created page, or null for a generic string * @param bool $createSubPage Set to false if a root page should be created */ diff --git a/tests/phpunit/includes/content/ContentHandlerTest.php b/tests/phpunit/includes/content/ContentHandlerTest.php index b564a29b7a..abedc6ceb8 100644 --- a/tests/phpunit/includes/content/ContentHandlerTest.php +++ b/tests/phpunit/includes/content/ContentHandlerTest.php @@ -486,7 +486,7 @@ 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 bool $hasLinks if it is known whether this content contains links, + * @param bool $hasLinks If it is known whether this content contains links, * provide this information here, to avoid redundant parsing to find out. * @return bool */ @@ -498,7 +498,7 @@ class DummyContentForTesting extends AbstractContent { * @param Title $title * @param int $revId Unused. * @param null|ParserOptions $options - * @param bool $generateHtml whether to generate Html (default: true). If false, the result + * @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/filerepo/file/FileTest.php b/tests/phpunit/includes/filerepo/file/FileTest.php index ffa9876625..8e8b8a9eb3 100644 --- a/tests/phpunit/includes/filerepo/file/FileTest.php +++ b/tests/phpunit/includes/filerepo/file/FileTest.php @@ -3,8 +3,8 @@ class FileTest extends MediaWikiMediaTestCase { /** - * @param $filename String - * @param $expected boolean + * @param string $filename + * @param bool $expected * @dataProvider providerCanAnimate */ function testCanAnimateThumbIfAppropriate( $filename, $expected ) { diff --git a/tests/phpunit/includes/media/JpegMetadataExtractorTest.php b/tests/phpunit/includes/media/JpegMetadataExtractorTest.php index 80e03cca19..7c977d5a45 100644 --- a/tests/phpunit/includes/media/JpegMetadataExtractorTest.php +++ b/tests/phpunit/includes/media/JpegMetadataExtractorTest.php @@ -23,7 +23,7 @@ class JpegMetadataExtractorTest extends MediaWikiTestCase { * We also use this test to test padding bytes don't * screw stuff up * - * @param string $file filename + * @param string $file Filename * * @dataProvider provideUtf8Comment */ diff --git a/tests/phpunit/includes/media/MediaWikiMediaTestCase.php b/tests/phpunit/includes/media/MediaWikiMediaTestCase.php index 1b8ecf27d6..8e56245445 100644 --- a/tests/phpunit/includes/media/MediaWikiMediaTestCase.php +++ b/tests/phpunit/includes/media/MediaWikiMediaTestCase.php @@ -69,8 +69,8 @@ abstract class MediaWikiMediaTestCase extends MediaWikiTestCase { * Utility function: Get a new file object for a file on disk but not actually in db. * * File must be in the path returned by getFilePath() - * @param $name String File name - * @param $type String MIME type [optional] + * @param string $name File name + * @param string $type MIME type [optional] * @return UnregisteredLocalFile */ protected function dataFile( $name, $type = null ) { diff --git a/tests/phpunit/includes/media/PNGTest.php b/tests/phpunit/includes/media/PNGTest.php index 9a4826ccc9..092be89eff 100644 --- a/tests/phpunit/includes/media/PNGTest.php +++ b/tests/phpunit/includes/media/PNGTest.php @@ -22,7 +22,7 @@ class PNGHandlerTest extends MediaWikiMediaTestCase { } /** - * @param string $filename basename of the file to check + * @param string $filename Basename of the file to check * @param bool $expected Expected result. * @dataProvider provideIsAnimated * @covers PNGHandler::isAnimatedImage diff --git a/tests/phpunit/includes/media/XCFTest.php b/tests/phpunit/includes/media/XCFTest.php index 7fc3275b2a..9b6391c4f3 100644 --- a/tests/phpunit/includes/media/XCFTest.php +++ b/tests/phpunit/includes/media/XCFTest.php @@ -16,8 +16,8 @@ class XCFHandlerTest extends MediaWikiMediaTestCase { /** * @param string $filename - * @param int $expectedWidth width - * @param int $expectedHeigh height + * @param int $expectedWidth Width + * @param int $expectedHeigh Height * @dataProvider provideGetImageSize * @covers XCFHandler::getImageSize */ diff --git a/tests/phpunit/includes/parser/MagicVariableTest.php b/tests/phpunit/includes/parser/MagicVariableTest.php index d36697eb15..17226113e5 100644 --- a/tests/phpunit/includes/parser/MagicVariableTest.php +++ b/tests/phpunit/includes/parser/MagicVariableTest.php @@ -171,7 +171,7 @@ class MagicVariableTest extends MediaWikiTestCase { * Main assertion helper for magic variables padding * @param string $magic Magic variable name * @param mixed $value Month or day - * @param string $format sprintf format for $value + * @param string $format Sprintf format for $value */ private function assertMagicPadding( $magic, $value, $format ) { # Initialize parser timestamp as year 2010 at 12h34 56s. diff --git a/tests/phpunit/includes/parser/MediaWikiParserTest.php b/tests/phpunit/includes/parser/MediaWikiParserTest.php index a506c86269..a450972334 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 int $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/specials/SpecialMIMESearchTest.php b/tests/phpunit/includes/specials/SpecialMIMESearchTest.php index aca77be62e..bd952811ca 100644 --- a/tests/phpunit/includes/specials/SpecialMIMESearchTest.php +++ b/tests/phpunit/includes/specials/SpecialMIMESearchTest.php @@ -16,9 +16,9 @@ class SpecialMIMESearchTest extends MediaWikiTestCase { /** * @dataProvider providerMimeFiltering - * @param $par String subpage for special page - * @param $major String Major MIME type we expect to look for - * @param $minor String Minor MIME type we expect to look for + * @param string $par Subpage for special page + * @param string $major Major MIME type we expect to look for + * @param string $minor Minor MIME type we expect to look for */ function testMimeFiltering( $par, $major, $minor ) { $this->page->run( $par ); diff --git a/tests/phpunit/includes/specials/SpecialMyLanguageTest.php b/tests/phpunit/includes/specials/SpecialMyLanguageTest.php index c09d68ccd0..fd090431d5 100644 --- a/tests/phpunit/includes/specials/SpecialMyLanguageTest.php +++ b/tests/phpunit/includes/specials/SpecialMyLanguageTest.php @@ -26,10 +26,10 @@ class SpecialMyLanguageTest extends MediaWikiTestCase { /** * @covers SpecialMyLanguage::findTitle * @dataProvider provideFindTitle - * @param $expected - * @param $subpage - * @param $langCode - * @param $userLang + * @param string $expected + * @param string $subpage + * @param string $langCode + * @param string $userLang */ public function testFindTitle( $expected, $subpage, $langCode, $userLang ) { $this->setMwGlobals( 'wgLanguageCode', $langCode ); diff --git a/tests/phpunit/maintenance/backupPrefetchTest.php b/tests/phpunit/maintenance/backupPrefetchTest.php index 744cf616aa..5e0fe89d54 100644 --- a/tests/phpunit/maintenance/backupPrefetchTest.php +++ b/tests/phpunit/maintenance/backupPrefetchTest.php @@ -11,7 +11,7 @@ require_once __DIR__ . "/../../../maintenance/backupPrefetch.inc"; class BaseDumpTest extends MediaWikiTestCase { /** - * @var BaseDump the BaseDump instance used within a test. + * @var BaseDump The BaseDump instance used within a test. * * If set, this BaseDump gets automatically closed in tearDown. */ diff --git a/tests/phpunit/maintenance/fetchTextTest.php b/tests/phpunit/maintenance/fetchTextTest.php index 43f2096676..1ad4656f3c 100644 --- a/tests/phpunit/maintenance/fetchTextTest.php +++ b/tests/phpunit/maintenance/fetchTextTest.php @@ -91,7 +91,7 @@ class FetchTextTest extends MediaWikiTestCase { private $exceptionFromAddDBData; /** - * @var FetchText the (mocked) FetchText that is to test + * @var FetchText The (mocked) FetchText that is to test */ private $fetchText;