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;
/**
* 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.
/**
* Remove last character if it is a newline
* @group utility
+ * @param string $s
*/
public static function chomp( $s ) {
if ( substr( $s, -1 ) === "\n" ) {
/**
* Run a fuzz test series
* Draw input from a set of test files
+ * @param array $filenames
*/
function fuzzTest( $filenames ) {
$GLOBALS['wgContLang'] = Language::factory( 'en' );
/**
* Get an input dictionary from a set of parser test files
+ * @param array $filenames
*/
function getFuzzInput( $filenames ) {
$dict = '';
* 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;
* 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 ) {
/**
* Refactored in 1.22 to use ParserTestResult
+ * @param ParserTestResult $testResult
*/
function showTestResult( ParserTestResult $testResult ) {
if ( $testResult->isSuccess() ) {
/**
* 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 );
/**
* 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.
* 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;
/**
* Remove the dummy uploads directory
+ * @param string $dir
*/
private function teardownUploadDir( $dir ) {
if ( $this->keepUploads ) {
/**
* 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 ) {
/**
* 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 ) {
/**
* "Running test $desc..."
+ * @param string $desc
*/
protected function showTesting( $desc ) {
print "Running test $desc... ";
*
* 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 ) {
*
* 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 ) {
* 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'
/**
* 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" );
* 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(
/**
* Show "Reading tests from ..."
*
- * @param $path String
+ * @param string $path
*/
public function showRunFile( $path ) {
print $this->term->color( 1 ) .
/**
* 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;
* 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;
* 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;
* 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;
*
* @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 ) . '_' );
* 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
*/
/**
* 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 );
/**
* @since 1.18
+ * @param string $offset
+ * @return mixed
*/
public function getCliArg( $offset ) {
if ( isset( MediaWikiPHPUnitCommand::$additionalOptions[$offset] ) ) {
/**
* @since 1.18
+ * @param string $offset
+ * @param mixed $value
*/
public function setCliArg( $offset, $value ) {
MediaWikiPHPUnitCommand::$additionalOptions[$offset] = $value;
* @since 1.19
*
* @param string $function
- * @return null
*/
public function hideDeprecated( $function ) {
wfSuppressWarnings();
* test whenever it is not loaded.
*
* @since 1.21
+ * @param string $extName
+ * @return bool
*/
protected function checkPHPExtension( $extName ) {
$loaded = extension_loaded( $extName );
* 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
*/
/**
* 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
*/
/**
* 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
* * 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.
*/
/**
* 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 ) {
*
* 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 ) {
*
* @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 ) {
*
* @dataProvider provideInvalidPatterns
*
- * @param $pattern string: Invalid search pattern
+ * @param string $pattern Invalid search pattern
*/
function testMakeLikeArrayWithInvalidPatterns( $pattern ) {
* @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(
/**
* @dataProvider provideGetFragment
*
- * @param $full
- * @param $fragment
+ * @param string $full
+ * @param string $fragment
*/
public function testGetFragment( $full, $fragment ) {
$title = Title::newFromText( $full );
/**
* @param Title $title
- * @param String $model
+ * @param string $model
* @return WikiPage
*/
protected function newPage( $title, $model = null ) {
}
/**
- * @param String|Title|WikiPage $page
- * @param String $text
+ * @param string|Title|WikiPage $page
+ * @param string $text
* @param int $model
*
* @return WikiPage
/**
* 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 );
* 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 ) {
/**
* 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 ) {
/**
* 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 );
* 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
*/
/**
* 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.
/**
* 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 ) {
* -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
*/
* @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;
/**
* @param string $format
* @param array $params
- * @param $data
+ * @param array $data
*
* @return string
*/
/**
* 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 );
/**
* 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 ) {
/**
* 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 ) {
*/
/**
- * @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 = ''
}
/**
- * @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;
* 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;
* @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
*/
/**
* @since 1.20
* @param array $data
- * @param boolean $loadDefaults
+ * @param bool $loadDefaults
* @return IORMRow
*/
protected function getRowInstance( array $data, $loadDefaults ) {
*
* @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 ) {
/**
* 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 ) {
/**
* 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 );
* 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(
* 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 );
}
/**
- * @param $filename String
- * @param $expected Integer Total image area
+ * @param string $filename
+ * @param int $expected Total image area
* @dataProvider provideFlattenArray
* @covers FormatMetadata::flattenArray
*/
/**
* 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
*/
}
/**
- * @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
*/
}
/**
- * @param $filename String
- * @param $expected Integer Total image area
+ * @param string $filename
+ * @param int $expected Total image area
* @dataProvider provideGetImageArea
* @covers GIFHandler::getImageArea
*/
}
/**
- * @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
*/
}
/**
- * @param $filename String
- * @param $expected String Serialized array
+ * @param string $filename
+ * @param string $expected Serialized array
* @dataProvider provideGetMetadata
* @covers GIFHandler::getMetadata
*/
}
/**
- * @param $filename String
- * @param $expected String Serialized array
+ * @param string $filename
+ * @param string $expected Serialized array
* @dataProvider provideGetIndependentMetaArray
* @covers GIFHandler::getCommonMetaArray
*/
}
/**
- * @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
*/
}
/**
- * @param $filename String
- * @param $expected Integer Total image area
+ * @param string $filename
+ * @param int $expected Total image area
* @dataProvider provideGetImageArea
* @covers PNGHandler::getImageArea
*/
}
/**
- * @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
*/
}
/**
- * @param $filename String
- * @param $expected String Serialized array
+ * @param string $filename
+ * @param string $expected Serialized array
* @dataProvider provideGetMetadata
* @covers PNGHandler::getMetadata
*/
}
/**
- * @param $filename String
- * @param $expected Array Expected standard metadata
+ * @param string $filename
+ * @param array $expected Expected standard metadata
* @dataProvider provideGetIndependentMetaArray
* @covers PNGHandler::getCommonMetaArray
*/
}
/**
- * @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
*/
/**
* 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
}
/**
- * @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();
}
/**
- * @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 );
/**
* 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.
$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;
/**
* 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 ) ) {
* 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
/**
* Get an FS upload directory (only applies to FSFileBackend)
*
- * @return String: the directory
+ * @return string The directory
*/
protected function getUploadDir() {
if ( $this->keepUploads ) {
* 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;
/**
* 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();
/**
* Set the file from whose tests will be run by this instance
+ * @param string $filename
*/
public function setParserTestFile( $filename ) {
$this->file = $filename;
/**
* @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 ) ) {
/**
* Get an input dictionary from a set of parser test files
+ * @param array $filenames
*/
function getFuzzInput( $filenames ) {
$dict = '';
/**
* Get a Parser object
+ * @param Preprocessor $preprocessor
*/
function getParser( $preprocessor = null ) {
global $wgParserConf;
* 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;
* 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;
/**
* Remove last character if it is a newline
+ * @param string $s
*/
public function removeEndingNewline( $s ) {
if ( substr( $s, -1 ) === "\n" ) {
/**
* 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 );
/**
* 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 );
/**
* @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,
/**
* @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
*/
*/
class UploadStashTest extends MediaWikiTestCase {
/**
- * @var Array of UploadStashTestUser
+ * @var array Array of UploadStashTestUser
*/
public static $users;
##### 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(
/**
* 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(
* 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 );
* 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 );
##### 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(
/**
* 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(
* 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 );
* 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 );
/**
* 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
*/
/**
* 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 );
/**
* 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 </mediawiki>)
+ * @param string $name Name of the closing element to look for
+ * (e.g.: "mediawiki" when looking for </mediawiki>)
*
- * @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() ) {
* 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 </mediawiki>)
+ * @param string $name Name of the closing element to look for
+ * (e.g.: "mediawiki" when looking for </mediawiki>)
*
- * @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 ),
/**
* 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 </siteinfo>
+ * @param string $fname Name of file to analyze
+ * @param bool $skip_siteinfo (optional) If true, step the xml reader
+ * to the first element after </siteinfo>
*/
protected function assertDumpStart( $fname, $skip_siteinfo = true ) {
$this->xml = new XMLReader();
* 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 </mediawiki>)
+ * @param string $tag (optional) the name of the final tag
+ * (e.g.: "mediawiki" for </mediawiki>)
*/
protected function assertDumpEnd( $name = "mediawiki" ) {
$this->assertNodeEnd( $name, false );
* 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 <mediawiki>)
- * @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 <mediawiki>)
+ * @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" );
* 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 </mediawiki>)
- * @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 </mediawiki>)
+ * @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" );
* 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 <mediawiki>...</mediawiki>)
- * @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 <mediawiki>...</mediawiki>)
+ * @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 );
* 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 ) {
* 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
*
* 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 ) {
/**
* 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 ),
*
* 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
* 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
/**
* 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 ) {
/**
* 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
* 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()
class SemiMockedFetchText extends FetchText {
/**
- * @var String|null Text to pass as stdin
+ * @var string|null Text to pass as stdin
*/
private $mockStdinText = null;
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;
/**
* 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() {
/**
* 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
*/
/**
* Helper to relate FetchText's input and output
+ * @param string $input
+ * @param string $expectedOutput
*/
private function assertFilter( $input, $expectedOutput ) {
$this->fetchText->mockStdin( $input );
* 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' ) {
/**
* 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 = '' ) {
/**
* 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 ) {
/**
* 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 ) {
* 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;
/**
* 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 );
* 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 ) {
/**
* 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 ) ) {
/**
* 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;
/**
* 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;