Cleanup some docs (tests)
authorumherirrender <umherirrender_de.wp@web.de>
Thu, 24 Jul 2014 12:55:43 +0000 (14:55 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Mon, 11 Aug 2014 18:06:52 +0000 (20:06 +0200)
- 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

27 files changed:
tests/phpunit/MediaWikiTestCase.php
tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php
tests/phpunit/includes/HtmlFormatterTest.php
tests/phpunit/includes/ImagePage404Test.php
tests/phpunit/includes/ImagePageTest.php
tests/phpunit/includes/MimeMagicTest.php
tests/phpunit/includes/OutputPageTest.php
tests/phpunit/includes/StatusTest.php
tests/phpunit/includes/api/ApiMainTest.php
tests/phpunit/includes/api/ApiTestCase.php
tests/phpunit/includes/api/ApiTestCaseUpload.php
tests/phpunit/includes/api/RandomImageGenerator.php
tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php
tests/phpunit/includes/api/query/ApiQueryTestBase.php
tests/phpunit/includes/cache/MessageCacheTest.php
tests/phpunit/includes/content/ContentHandlerTest.php
tests/phpunit/includes/filerepo/file/FileTest.php
tests/phpunit/includes/media/JpegMetadataExtractorTest.php
tests/phpunit/includes/media/MediaWikiMediaTestCase.php
tests/phpunit/includes/media/PNGTest.php
tests/phpunit/includes/media/XCFTest.php
tests/phpunit/includes/parser/MagicVariableTest.php
tests/phpunit/includes/parser/MediaWikiParserTest.php
tests/phpunit/includes/specials/SpecialMIMESearchTest.php
tests/phpunit/includes/specials/SpecialMyLanguageTest.php
tests/phpunit/maintenance/backupPrefetchTest.php
tests/phpunit/maintenance/fetchTextTest.php

index 70cc8de..1fbc7a2 100644 (file)
@@ -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;
index 05155db..1faad52 100644 (file)
@@ -2,7 +2,7 @@
 
 /**
  * @group GlobalFunctions
- *@covers ::wfRemoveDotSegments
+ * @covers ::wfRemoveDotSegments
  */
 class WfRemoveDotSegmentsTest extends MediaWikiTestCase {
        /**
index ae5c9c4..9dbfa45 100644 (file)
@@ -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
         */
index 3660456..197a2b3 100644 (file)
@@ -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 );
index d5ecb95..0272c54 100644 (file)
@@ -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 );
index 19746a9..742d382 100644 (file)
@@ -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 );
index e866386..96f1c63 100644 (file)
@@ -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();
index b2e4459..11f867a 100644 (file)
@@ -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 ) {
index 8c5f540..780cf9e 100644 (file)
@@ -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 {
index 0976b1a..b556ef8 100644 (file)
@@ -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
index 837becc..7e51339 100644 (file)
@@ -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
index e3eea4c..328ea8e 100644 (file)
@@ -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;
index bd15f04..6f4479b 100644 (file)
@@ -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 ) {
index 1b9c1ce..f920ce9 100644 (file)
@@ -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( /*...*/ ) {
index 803acf7..442e9f9 100644 (file)
@@ -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
         */
index b564a29..abedc6c 100644 (file)
@@ -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
index ffa9876..8e8b8a9 100644 (file)
@@ -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 ) {
index 80e03cc..7c977d5 100644 (file)
@@ -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
         */
index 1b8ecf2..8e56245 100644 (file)
@@ -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 ) {
index 9a4826c..092be89 100644 (file)
@@ -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
index 7fc3275..9b6391c 100644 (file)
@@ -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
         */
index d36697e..1722611 100644 (file)
@@ -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.
index a506c86..a450972 100644 (file)
@@ -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
index aca77be..bd95281 100644 (file)
@@ -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 );
index c09d68c..fd09043 100644 (file)
@@ -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 );
index 744cf61..5e0fe89 100644 (file)
@@ -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.
         */
index 43f2096..1ad4656 100644 (file)
@@ -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;