*
* @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 ) {
* @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
*/
* @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;
/**
* @group GlobalFunctions
- *@covers ::wfRemoveDotSegments
+ * @covers ::wfRemoveDotSegments
*/
class WfRemoveDotSegmentsTest extends MediaWikiTestCase {
/**
* @dataProvider getHtmlData
*
* @param string $input
- * @param $expectedText
+ * @param string $expectedText
* @param array $expectedRemoved
* @param callable|bool $callback
*/
/**
* @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 );
/**
* @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' );
/**
* @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 );
/**
* @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 );
* 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();
}
/**
- * @param array $messageDetails eg. array( 'KEY' => array(/PARAMS/) )
+ * @param array $messageDetails E.g. array( 'KEY' => array(/PARAMS/) )
* @return Message[]
*/
protected function getMockMessages( $messageDetails ) {
* @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 {
/**
* 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 );
* 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
/**
* 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
*/
/**
* 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
*/
* 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
*/
* 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
/**
* 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(
*
* 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;
* @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 );
* @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 ) {
/**
* 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( /*...*/ ) {
* 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
*/
* 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
*/
* @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
class FileTest extends MediaWikiMediaTestCase {
/**
- * @param $filename String
- * @param $expected boolean
+ * @param string $filename
+ * @param bool $expected
* @dataProvider providerCanAnimate
*/
function testCanAnimateThumbIfAppropriate( $filename, $expected ) {
* We also use this test to test padding bytes don't
* screw stuff up
*
- * @param string $file filename
+ * @param string $file Filename
*
* @dataProvider provideUtf8Comment
*/
* 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 ) {
}
/**
- * @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
/**
* @param string $filename
- * @param int $expectedWidth width
- * @param int $expectedHeigh height
+ * @param int $expectedWidth Width
+ * @param int $expectedHeigh Height
* @dataProvider provideGetImageSize
* @covers XCFHandler::getImageSize
*/
* 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.
* 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
/**
* @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 );
/**
* @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 );
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.
*/
private $exceptionFromAddDBData;
/**
- * @var FetchText the (mocked) FetchText that is to test
+ * @var FetchText The (mocked) FetchText that is to test
*/
private $fetchText;