$wgTitle = null;
/**
- * @deprecated 1.24 Use DeferredUpdates::addUpdate instead
+ * @deprecated since 1.24 Use DeferredUpdates::addUpdate instead
* @var array
*/
$wgDeferredUpdateList = array();
}
/**
- * @param int $maxLength Maximum length of the summary text, defaults to 250.
+ * @param int $maxlength Maximum length of the summary text, defaults to 250.
*
* @return string The summary text.
*
* Get the RequestContext object associated with the main request
* and gives a warning to the log, to find places, where a context maybe is missing.
*
+ * @param string $func
* @return RequestContext
* @since 1.24
*/
* background-image: url(@url) !ie;
* }
* @endcode
+ * @param array $frame
+ * @param lessc $less
*/
public static function embeddable( $frame, $less ) {
$base = pathinfo( $less->parser->sourceName, PATHINFO_DIRNAME );
* background-image: embed('../images/button-bg.png');
* }
* @endcode
+ * @param array $frame
+ * @param lessc $less
+ * @return string
*/
public static function embed( $frame, $less ) {
$base = pathinfo( $less->parser->sourceName, PATHINFO_DIRNAME );
* Returns the first few lines of the text
*
* @param string $text
- * @param int $contextlines max number of returned lines
- * @param int $contextchars average number of characters per line
+ * @param int $contextlines Max number of returned lines
+ * @param int $contextchars Average number of characters per line
* @return string
*/
public function highlightNone( $text, $contextlines, $contextchars ) {
/**
* Get the cached separator pattern for ConverterRule::parseRules()
+ * @return string
*/
function getVarSeparatorPattern() {
if ( is_null( $this->mVarSeparatorPattern ) ) {
/**
* @param Title $title
+ * @return array
*/
function templateHook( $title ) {
$titleText = $title->getPrefixedDBkey();
* assuming an ordering of cl_to, cl_type, cl_from
* @param stdClass $row
* @param DatabaseBase $dbw
+ * @return string
*/
function getBatchCondition( $row, $dbw ) {
$fields = array( 'cl_to', 'cl_type', 'cl_from' );
* Remove last character if it is a newline
* @group utility
* @param string $s
+ * @return string
*/
public static function chomp( $s ) {
if ( substr( $s, -1 ) === "\n" ) {
/**
* Get an input dictionary from a set of parser test files
* @param array $filenames
+ * @return string
*/
function getFuzzInput( $filenames ) {
$dict = '';
/**
* Get a memory usage breakdown
+ * @return array
*/
function getMemoryBreakdown() {
$memStats = array();
/**
* Refactored in 1.22 to use ParserTestResult
* @param ParserTestResult $testResult
+ * @return bool
*/
function showTestResult( ParserTestResult $testResult ) {
if ( $testResult->isSuccess() ) {
* @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
+ * @return mixed
*/
private static function getOptionValue( $key, $opts, $default ) {
$key = strtolower( $key );
* Ideally this should replace the global configuration entirely.
* @param string $opts
* @param string $config
+ * @return RequestContext
*/
private function setupGlobals( $opts = '', $config = '' ) {
global $IP;
/**
* List of temporary tables to create, without prefix.
* Some of these probably aren't necessary.
+ * @return array
*/
private function listTables() {
$tables = array( 'user', 'user_properties', 'user_former_groups', 'page', 'page_restrictions',
* User input text is passed to rtrim() by edit page. This is a simple
* wrapper around assertEquals() which calls rrtrim() to normalize the
* expected and actual texts.
+ * @param string $expected
+ * @param string $actual
+ * @param string $msg
*/
protected function assertEditedTextEquals( $expected, $actual, $msg = '' ) {
return $this->assertEquals( rtrim( $expected ), rtrim( $actual ), $msg );
/**
* Set up the global variables for a consistent environment for each test.
* Ideally this should replace the global configuration entirely.
+ * @param array $opts
+ * @param string $config
+ * @return RequestContext
*/
protected function setupGlobals( $opts = array(), $config = '' ) {
global $wgFileBackends;
/**
* Get an input dictionary from a set of parser test files
* @param array $filenames
+ * @return string
*/
function getFuzzInput( $filenames ) {
$dict = '';
/**
* Get a memory usage breakdown
+ * @return array
*/
function getMemoryBreakdown() {
$memStats = array();
/**
* Get a Parser object
* @param Preprocessor $preprocessor
+ * @return Parser
*/
function getParser( $preprocessor = null ) {
global $wgParserConf;
/**
* Remove last character if it is a newline
* @param string $s
+ * @return string
*/
public function removeEndingNewline( $s ) {
if ( substr( $s, -1 ) === "\n" ) {
* @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
+ * @return mixed
*/
protected static function getOptionValue( $key, $opts, $default ) {
$key = strtolower( $key );
* Helper function to perform an async upload, execute the job and fetch
* the status
*
+ * @param string $token
+ * @param bool $ignoreWarnings
+ * @param bool $leaveMessage
* @return array The result of action=upload&statuskey=key
*/
private function doAsyncUpload( $token, $ignoreWarnings = false, $leaveMessage = false ) {
}
/**
- * Print high range characters as an hexadecimal
+ * Print high range characters as a hexadecimal
+ * @param string $string
+ * @return string
*/
function escaped( $string ) {
$escaped = '';
* @param Page $page Page to add the revision to
* @param string $text Revisions text
* @param string $summary Revisions summare
- *
+ * @return array
* @throws MWException
*/
protected function addRevision( Page $page, $text, $summary ) {
* @param WikiPage $page The page to add the revision to
* @param string $text The revisions text
* @param string $summary The revisions summare
- *
+ * @return int
* @throws MWException
*/
private function addRevision( $page, $text, $summary ) {
/**
* Get all registered modules from ResouceLoader.
+ * @return array
*/
protected static function getAllModules() {
global $wgEnableJavaScriptTest;
/**
* Filter to remove testUnitTestFileNamesEndWithTest false positives.
+ * @param string $filename
+ * @return bool
*/
public function filterSuites( $filename ) {
return strpos( $filename, __DIR__ . '/../suites/' ) !== 0;
/**
* Remove the dummy uploads directory
+ * @param string $dir
*/
private function teardownUploadDir( $dir ) {
if ( $this->keepUploads ) {
*/
interface ITestRecorder {
- /** Called at beginning of the parser test run */
+ /**
+ * Called at beginning of the parser test run
+ */
public function start();
- /** Called after each test */
+ /**
+ * Called after each test
+ * @param string $test
+ * @param bool $result
+ */
public function record( $test, $result );
- /** Called before finishing the test run */
+ /**
+ * Called before finishing the test run
+ */
public function report();
- /** Called at the end of the parser test run */
+ /**
+ * Called at the end of the parser test run
+ */
public function end();
}
/**
* This should be called before the table prefix is changed
+ * @param TestRecorder $parent
*/
function __construct( $parent ) {
parent::__construct( $parent );
* Returns a string giving information about when a test last had a status change.
* Could help to track down when regressions were introduced, as distinct from tests
* which have never passed (which are more change requests than regressions).
+ * @param string $testname
+ * @param string $after
+ * @return string
*/
private function getTestStatusInfo( $testname, $after ) {
// If we're looking at a test that has just been removed, then say when it first appeared.
* mentioned before closing this section
* @param bool $fatal True iff an exception should be thrown if
* the section is not found.
+ * @return bool|string
*/
private function checkSection( $tokens, $fatal = true ) {
if ( is_null( $this->section ) ) {
* 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
+ * @return bool
*/
public function unleash( &$parserTest ) {
if ( !( $parserTest instanceof ParserTest || $parserTest instanceof NewParserTest ) ) {