* (bug 54597) $wgBlockOpenProxies, $wgProxyPorts, $wgProxyScriptPath, and
$wgProxyMemcExpiry have been removed, along with the open proxy scanner
script they were added for.
+* Default value of $wgMaxShellMemory has been tripled (it's now 300 MB).
=== New features in 1.22 ===
* (bug 44525) mediawiki.jqueryMsg can now parse (whitelisted) HTML elements and attributes.
output in a HTML comment.
* The 'UnwatchArticle' and 'WatchArticle' hooks now support a Status object
instead of just a boolean return value to abort the hook.
+* Added a hook, SpecialWatchlistGetNonRevisionTypes, to allow extensions
+ with custom recentchanges entries to hook into the Watchlist without
+ clobbering each other.
+* A hidden, empty input field was added to the edit form, and any edit that fills
+ it in will be rejected. This prevents against the simplest form of spambots.
+ Previously in the "SimpleAntiSpam" extension by Ryan Schmidt.
=== Bug fixes in 1.22 ===
* Disable Special:PasswordReset when $wgEnableEmail is false. Previously one
--- /dev/null
+Security reminder: MediaWiki does not require PHP's register_globals. If you
+have it on, turn it '''off''' if you can.
+
+== MediaWiki 1.23 ==
+
+THIS IS NOT A RELEASE YET
+
+MediaWiki 1.23 is an alpha-quality branch and is not recommended for use in
+production.
+
+=== Configuration changes in 1.23 ===
+
+=== New features in 1.23 ===
+
+=== Bug fixes in 1.23 ===
+
+=== API changes in 1.23 ===
+
+=== Languages updated in 1.23===
+
+MediaWiki supports over 350 languages. Many localisations are updated
+regularly. Below only new and removed languages are listed, as well as
+changes to languages because of Bugzilla reports.
+
+=== Other changes in 1.23 ===
+
+== Compatibility ==
+
+MediaWiki 1.23 requires PHP 5.3.2 or later.
+
+MySQL is the recommended DBMS. PostgreSQL or SQLite can also be used, but
+support for them is somewhat less mature. There is experimental support for
+Oracle.
+
+The supported versions are:
+
+* MySQL 5.0.2 or later
+* PostgreSQL 8.3 or later
+* SQLite 3.3.7 or later
+* Oracle 9.0.1 or later
+
+== Upgrading ==
+
+1.23 has several database changes since 1.22, and will not work without schema
+updates. Note that due to changes to some very large tables like the revision
+table, the schema update may take quite long (minutes on a medium sized site,
+many hours on a large site).
+
+If upgrading from before 1.11, and you are using a wiki as a commons
+repository, make sure that it is updated as well. Otherwise, errors may arise
+due to database schema changes.
+
+If upgrading from before 1.7, you may want to run refreshLinks.php to ensure
+new database fields are filled with data.
+
+If you are upgrading from MediaWiki 1.4.x or earlier, you should upgrade to
+1.5 first. The upgrade script maintenance/upgrade1_5.php has been removed
+with MediaWiki 1.21.
+
+Don't forget to always back up your database before upgrading!
+
+See the file UPGRADE for more detailed upgrade instructions.
+
+For notes on 1.21.x and older releases, see HISTORY.
+
+== Online documentation ==
+
+Documentation for both end-users and site administrators is available on
+MediaWiki.org, and is covered under the GNU Free Documentation License (except
+for pages that explicitly state that their contents are in the public domain):
+
+ https://www.mediawiki.org/wiki/Documentation
+
+== Mailing list ==
+
+A mailing list is available for MediaWiki user support and discussion:
+
+ https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
+
+A low-traffic announcements-only list is also available:
+
+ https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce
+
+It's highly recommended that you sign up for one of these lists if you're
+going to run a public MediaWiki, so you can be notified of security fixes.
+
+== IRC help ==
+
+There's usually someone online in #mediawiki on irc.freenode.net.
&$fields: array of query fields
$values: array of variables with watchlist options
+'SpecialWatchlistGetNonRevisionTypes': Called when building sql query for
+SpecialWatchlist. Allows extensions to register custom values they have
+inserted to rc_type so they can be returned as part of the watchlist.
+&$nonRevisionTypes: array of values in the rc_type field of recentchanges table
+
'TestCanonicalRedirect': Called when about to force a redirect to a canonical
URL for a title when we have no other parameters on the URL. Gives a chance for
extensions that alter page view behavior radically to abort that redirect or
* MediaWiki version number
* @since 1.2
*/
-$wgVersion = '1.22alpha';
+$wgVersion = '1.23alpha';
/**
* Name of the site. It must be changed in LocalSettings.php
*/
$wgCascadingRestrictionLevels = array( 'sysop' );
+/**
+ * Restriction levels that should be considered "semiprotected"
+ *
+ * Certain places in the interface recognize a dichotomy between "protected"
+ * and "semiprotected", without further distinguishing the specific levels. In
+ * general, if anyone can be eligible to edit a protection level merely by
+ * reaching some condition in $wgAutopromote, it should probably be considered
+ * "semiprotected".
+ *
+ * 'autoconfirmed' is quietly rewritten to 'editsemiprotected' for backwards compatibility.
+ * 'sysop' is not changed, since it really shouldn't be here.
+ */
+$wgSemiprotectedRestrictionLevels = array( 'autoconfirmed' );
+
/**
* Set the minimum permissions required to edit pages in each
* namespace. If you list more than one permission, a user must
/**
* Maximum amount of virtual memory available to shell processes under linux, in KB.
*/
-$wgMaxShellMemory = 102400;
+$wgMaxShellMemory = 307200;
/**
* Maximum file size created by shell processes under linux, in KB
return $status;
}
+ $spam = $wgRequest->getText( 'wpAntispam' );
+ if ( $spam !== '' ) {
+ wfDebugLog(
+ 'SimpleAntiSpam',
+ $wgUser->getName() .
+ ' editing "' .
+ $this->mTitle->getPrefixedText() .
+ '" submitted bogus field "' .
+ $spam .
+ '"'
+ );
+ $status->fatal( 'spamprotectionmatch', false );
+ $status->value = self::AS_SPAM_ERROR;
+ wfProfileOut( __METHOD__ . '-checks' );
+ wfProfileOut( __METHOD__ );
+ return $status;
+ }
+
try {
# Construct Content object
$textbox_content = $this->toEditContent( $this->textbox1 );
call_user_func_array( $formCallback, array( &$wgOut ) );
}
+ // Add an empty field to trip up spambots
+ $wgOut->addHTML(
+ Xml::openElement( 'div', array( 'id' => 'antispam-container', 'style' => 'display: none;' ) )
+ . Html::rawElement( 'label', array( 'for' => 'wpAntiSpam' ), wfMessage( 'simpleantispam-label' )->parse() )
+ . Xml::element( 'input', array( 'type' => 'text', 'name' => 'wpAntispam', 'id' => 'wpAntispam', 'value' => '' ) )
+ . Xml::closeElement( 'div' )
+ );
+
wfRunHooks( 'EditPage::showEditForm:fields', array( &$this, &$wgOut ) );
// Put these up at the top to ensure they aren't lost on early form submission
$this->loadFile();
$descUrl = $this->mPage->getFile()->getDescriptionUrl();
- $descText = $this->mPage->getFile()->getDescriptionText();
+ $descText = $this->mPage->getFile()->getDescriptionText( $this->getContext()->getLanguage() );
/* Add canonical to head if there is no local page for this shared file */
if ( $descUrl && $this->mPage->getID() == 0 ) {
$accesskey = self::accesskey( $name );
if ( $accesskey !== false ) {
if ( $tooltip === false || $tooltip === '' ) {
- $tooltip = "[$accesskey]";
+ $tooltip = wfMessage( 'brackets', $accesskey )->escaped();
} else {
- $tooltip .= " [$accesskey]";
+ $tooltip .= wfMessage( 'word-separator' )->escaped();
+ $tooltip .= wfMessage( 'brackets', $accesskey )->escaped();
}
}
}
* @return Tuple(type, value)
*/
protected function extractParam( $param ) {
- if ( is_array( $param ) ){
+ if ( is_array( $param ) ) {
if ( isset( $param['raw'] ) ) {
return array( 'after', $param['raw'] );
} elseif ( isset( $param['num'] ) ) {
);
return array( 'before', '[INVALID]' );
}
+ } elseif ( $param instanceof Message ) {
+ // Message objects should not be before parameters because
+ // then they'll get double escaped. If the message needs to be
+ // escaped, it'll happen right here when we call toString().
+ return array( 'after', $param->toString() );
} else {
return array( 'before', $param );
}
*/
private $mTarget = null;
+ /**
+ * @var bool: Whether output should contain table of contents
+ */
+ private $mEnableTOC = true;
+
/**
* Constructor for OutputPage. This should not be called directly.
* Instead a new RequestContext should be created and it will implicitly create
*/
function addParserOutput( &$parserOutput ) {
$this->addParserOutputNoText( $parserOutput );
+ $parserOutput->setTOCEnabled( $this->mEnableTOC );
$text = $parserOutput->getText();
wfRunHooks( 'OutputPageBeforeHTML', array( &$this, &$text ) );
$this->addHTML( $text );
return array();
}
+ /**
+ * Enables/disables TOC, doesn't override __NOTOC__
+ * @param bool $flag
+ * @since 1.22
+ */
+ public function enableTOC( $flag = true ) {
+ $this->mEnableTOC = $flag;
+ }
+
+ /**
+ * @return bool
+ * @since 1.22
+ */
+ public function isTOCEnabled() {
+ return $this->mEnableTOC;
+ }
}
}
}
if ( count( $this->errors ) == 1 ) {
- $s = $this->getErrorMessage( $this->errors[0] );
+ $s = $this->getErrorMessage( $this->errors[0] )->plain();
if ( $shortContext ) {
$s = wfMessage( $shortContext, $s )->plain();
} elseif ( $longContext ) {
$s = wfMessage( $longContext, "* $s\n" )->plain();
}
} else {
- $s = '* ' . implode( "\n* ",
- $this->getErrorMessageArray( $this->errors ) ) . "\n";
+ $errors = $this->getErrorMessageArray( $this->errors );
+ foreach ( $errors as &$error ) {
+ $error = $error->plain();
+ }
+ $s = '* ' . implode( "\n* ", $errors ) . "\n";
if ( $longContext ) {
$s = wfMessage( $longContext, $s )->plain();
} elseif ( $shortContext ) {
return $s;
}
+ /**
+ * Get the error list as a Message object
+ *
+ * @param string $shortContext a short enclosing context message name, to
+ * be used when there is a single error
+ * @param string $longContext a long enclosing context message name, for a list
+ * @return Message
+ */
+ function getMessage( $shortContext = false, $longContext = false ) {
+ if ( count( $this->errors ) == 0 ) {
+ if ( $this->ok ) {
+ $this->fatal( 'internalerror_info',
+ __METHOD__ . " called for a good result, this is incorrect\n" );
+ } else {
+ $this->fatal( 'internalerror_info',
+ __METHOD__ . ": Invalid result object: no error text but not OK\n" );
+ }
+ }
+ if ( count( $this->errors ) == 1 ) {
+ $s = $this->getErrorMessage( $this->errors[0] );
+ if ( $shortContext ) {
+ $s = wfMessage( $shortContext, $s );
+ } elseif ( $longContext ) {
+ $wrapper = new RawMessage( "* \$1\n" );
+ $wrapper->params( $s )->parse();
+ $s = wfMessage( $longContext, $wrapper );
+ }
+ } else {
+ $msgs = $this->getErrorMessageArray( $this->errors );
+ $msgCount = count( $msgs );
+
+ if ( $shortContext ) {
+ $msgCount++;
+ }
+
+ $wrapper = new RawMessage( '* $' . implode( "\n* \$", range( 1, $msgCount ) ) );
+ $s = $wrapper->params( $msgs )->parse();
+
+ if ( $longContext ) {
+ $s = wfMessage( $longContext, $wrapper );
+ } elseif ( $shortContext ) {
+ $wrapper = new RawMessage( "\n\$1\n", $wrapper );
+ $wrapper->parse();
+ $s = wfMessage( $shortContext, $wrapper );
+ }
+ }
+
+ return $s;
+ }
+
/**
* Return the message for a single error.
* @param $error Mixed With an array & two values keyed by
} else {
$msg = wfMessage( $error );
}
- return $msg->plain();
+ return $msg;
}
/**
return $replaced;
}
- /**
- * Backward compatibility function for WikiError -> Status migration
- *
- * @return String
- */
- public function getMessage() {
- return $this->getWikiText();
- }
-
/**
* @return mixed
*/
}
/**
- * Is this page "semi-protected" - the *only* protection is autoconfirm?
+ * Is this page "semi-protected" - the *only* protection levels are listed
+ * in $wgSemiprotectedRestrictionLevels?
*
* @param string $action Action to check (default: edit)
* @return Bool
*/
public function isSemiProtected( $action = 'edit' ) {
- if ( $this->exists() ) {
- $restrictions = $this->getRestrictions( $action );
- if ( count( $restrictions ) > 0 ) {
- foreach ( $restrictions as $restriction ) {
- if ( strtolower( $restriction ) != 'editsemiprotected' &&
- strtolower( $restriction ) != 'autoconfirmed' // BC
- ) {
- return false;
- }
- }
- } else {
- # Not protected
- return false;
- }
- return true;
- } else {
- # If it doesn't exist, it can't be protected
+ global $wgSemiprotectedRestrictionLevels;
+
+ $restrictions = $this->getRestrictions( $action );
+ $semi = $wgSemiprotectedRestrictionLevels;
+ if ( !$restrictions || !$semi ) {
+ // Not protected, or all protection is full protection
return false;
}
+
+ // Remap autoconfirmed to editsemiprotected for BC
+ foreach ( array_keys( $semi, 'autoconfirmed' ) as $key ) {
+ $semi[$key] = 'editsemiprotected';
+ }
+ foreach ( array_keys( $restrictions, 'autoconfirmed' ) as $key ) {
+ $restrictions[$key] = 'editsemiprotected';
+ }
+
+ return !array_diff( $restrictions, $semi );
}
/**
// Clear any file cache entries
$this->clearCache();
- $supportedOps = array( 'create', 'store', 'copy', 'move', 'delete', 'null' );
+ $supportedOps = array( 'create', 'store', 'copy', 'move', 'delete', 'describe', 'null' );
$async = ( $this->parallelize === 'implicit' && count( $ops ) > 1 );
$maxConcurrency = $this->concurrency; // throttle
# Marker Suffix needs to be accessible staticly.
const MARKER_SUFFIX = "-QINU\x7f";
+ # Markers used for wrapping the table of contents
+ const TOC_START = '<mw:toc>';
+ const TOC_END = '</mw:toc>';
+
# Persistent:
var $mTagHooks = array();
var $mTransparentTagHooks = array();
$openmatch = preg_match( '/(?:<table|<h1|<h2|<h3|<h4|<h5|<h6|<pre|<tr|<p|<ul|<ol|<dl|<li|<\\/tr|<\\/td|<\\/th)/iS', $t );
$closematch = preg_match(
'/(?:<\\/table|<\\/h1|<\\/h2|<\\/h3|<\\/h4|<\\/h5|<\\/h6|' .
- '<td|<th|<\\/?blockquote|<\\/?div|<hr|<\\/pre|<\\/p|' . $this->mUniqPrefix . '-pre|<\\/li|<\\/ul|<\\/ol|<\\/dl|<\\/?center)/iS', $t );
+ '<td|<th|<\\/?blockquote|<\\/?div|<hr|<\\/pre|<\\/p|<\\/mw:|' . $this->mUniqPrefix . '-pre|<\\/li|<\\/ul|<\\/ol|<\\/dl|<\\/?center)/iS', $t );
if ( $openmatch or $closematch ) {
$paragraphStack = false;
# TODO bug 5718: paragraph closed
}
$toc = Linker::tocList( $toc, $this->mOptions->getUserLangObj() );
$this->mOutput->setTOCHTML( $toc );
+ $toc = self::TOC_START . $toc . self::TOC_END;
}
if ( $isMain ) {
$mEditSectionTokens = false, # prefix/suffix markers if edit sections were output as tokens
$mProperties = array(), # Name/value pairs to be cached in the DB
$mTOCHTML = '', # HTML of the TOC
- $mTimestamp; # Timestamp of the revision
+ $mTimestamp, # Timestamp of the revision
+ $mTOCEnabled = true; # Whether TOC should be shown, can't override __NOTOC__
private $mIndexPolicy = ''; # 'index' or 'noindex'? Any other value will result in no change.
private $mAccessedOptions = array(); # List of ParserOptions (stored in the keys)
private $mSecondaryDataUpdates = array(); # List of DataUpdate, used to save info from the page somewhere else.
}
function getText() {
+ wfProfileIn( __METHOD__ );
+ $text = $this->mText;
if ( $this->mEditSectionTokens ) {
- return preg_replace_callback( ParserOutput::EDITSECTION_REGEX,
- array( &$this, 'replaceEditSectionLinksCallback' ), $this->mText );
+ $text = preg_replace_callback( ParserOutput::EDITSECTION_REGEX,
+ array( &$this, 'replaceEditSectionLinksCallback' ), $text );
+ } else {
+ $text = preg_replace( ParserOutput::EDITSECTION_REGEX, '', $text );
+ }
+
+ // If you have an old cached version of this class - sorry, you can't disable the TOC
+ if ( isset( $this->mTOCEnabled ) && $this->mTOCEnabled ) {
+ $text = str_replace( array( Parser::TOC_START, Parser::TOC_END ), '', $text );
+ } else {
+ $text = preg_replace(
+ '#'. preg_quote( Parser::TOC_START ) . '.*?' . preg_quote( Parser::TOC_END ) . '#s',
+ '',
+ $text
+ );
}
- return preg_replace( ParserOutput::EDITSECTION_REGEX, '', $this->mText );
+ wfProfileOut( __METHOD__ );
+ return $text;
}
/**
function getTOCHTML() { return $this->mTOCHTML; }
function getTimestamp() { return $this->mTimestamp; }
function getLimitReportData() { return $this->mLimitReportData; }
+ function getTOCEnabled() { return $this->mTOCEnabled; }
function setText( $text ) { return wfSetVar( $this->mText, $text ); }
function setLanguageLinks( $ll ) { return wfSetVar( $this->mLanguageLinks, $ll ); }
function setIndexPolicy( $policy ) { return wfSetVar( $this->mIndexPolicy, $policy ); }
function setTOCHTML( $tochtml ) { return wfSetVar( $this->mTOCHTML, $tochtml ); }
function setTimestamp( $timestamp ) { return wfSetVar( $this->mTimestamp, $timestamp ); }
+ function setTOCEnabled( $flag ) { return wfSetVar( $this->mTOCEnabled, $flag ); }
function addCategory( $c, $sort ) { $this->mCategories[$c] = $sort; }
function addLanguageLink( $t ) { $this->mLanguageLinks[] = $t; }
} else {
$parentLen = 0;
if ( isset( $this->mParentLens[$row->rev_parent_id] ) ) {
- $this->mParentLens[$row->rev_parent_id];
+ $parentLen = $this->mParentLens[$row->rev_parent_id];
}
$chardiff = ' <span class="mw-changeslist-separator">. .</span> ';
$status = $this->addNewaccountInternal();
if ( !$status->isGood() ) {
- $error = $this->getOutput()->parse( $status->getWikiText() );
- $this->mainLoginForm( $error );
+ $error = $status->getMessage();
+ $this->mainLoginForm( $error->toString() );
return;
}
# Create the account and abort if there's a problem doing so
$status = $this->addNewAccountInternal();
if ( !$status->isGood() ) {
- $error = $this->getOutput()->parse( $status->getWikiText() );
- $this->mainLoginForm( $error );
+ $error = $status->getMessage();
+ $this->mainLoginForm( $error->toString() );
return false;
}
if ( !wfRunHooks( 'AbortNewAccount', array( $u, &$abortError ) ) ) {
// Hook point to add extra creation throttles and blocks
wfDebug( "LoginForm::addNewAccountInternal: a hook blocked creation\n" );
- return Status::newFatal( new RawMessage( $abortError ) );
+ $abortError = new RawMessage( $abortError );
+ $abortError->text();
+ return Status::newFatal( $abortError );
}
// Hook point to check for exempt from account creation throttle
$usePage = false;
} else {
# Top log Ids for a page are not stored
- $conds[] = 'rc_this_oldid=page_latest OR rc_type=' . RC_LOG;
+ $nonRevisionTypes = array( RC_LOG );
+ wfRunHooks( 'SpecialWatchlistGetNonRevisionTypes', array( &$nonRevisionTypes ) );
+ if ( $nonRevisionTypes ) {
+ if ( count( $nonRevisionTypes ) === 1 ) {
+ // if only one use an equality instead of IN condition
+ $nonRevisionTypes = reset( $nonRevisionTypes );
+ }
+ $conds[] = $dbr->makeList(
+ array(
+ 'rc_this_oldid=page_latest',
+ 'rc_type' => $nonRevisionTypes,
+ ),
+ LIST_OR
+ );
+ }
$limitWatchlist = 0;
$usePage = true;
}
'spam_reverting' => 'Besig met terugrol na die laaste weergawe wat nie skakels na $1 bevat nie',
'spam_blanking' => "Alle weergawes met 'n skakel na $1 word verwyder",
'spam_deleting' => 'Alle weergawes bevat verwysings na $1. Bladsy verwyder',
+'simpleantispam-label' => "Anti-spam kontrole.
+'''Moenie''' die veld invul nie!",
# Info page
'pageinfo-title' => 'Inligting oor "$1"',
'siteusers' => '{{SITENAME}} {{PLURAL:$2|përdorues|përdorues}} $1',
'creditspage' => 'Kreditat e faqes',
+# Spam protection
+'simpleantispam-label' => "Anti-spam kontrolloni. A'''''NUK' plotësoni këtë!",
+
# Browsing diffs
'previousdiff' => '← Redaktim mâ i vjetër',
'nextdiff' => 'Redaktim ma i ri →',
'spambot_username' => 'Esporga de spam de MediaWiki',
'spam_reverting' => "Tornando t'a zaguera versión sin de vinclos ta $1",
'spam_blanking' => 'Todas as versions teneban vinclos ta $1, se deixa en blanco',
+'simpleantispam-label' => "Preba anti-spam.
+'''NO''' replene esto!",
# Info page
'pageinfo-title' => 'Información ta «$1»',
'spam_reverting' => 'استرجاع آخر نسخة ليس بها وصلات إلى $1',
'spam_blanking' => 'كل النسخ احتوت على وصلات ل $1، إفراغ',
'spam_deleting' => 'جميع النسخ تحوي رابطا إلى $1، يتم الحذف',
+'simpleantispam-label' => "اختبار ضد السبام.
+'''لا''' تملأ هذا!",
# Info page
'pageinfo-title' => 'المعلومات عن «$1»',
'spambot_username' => 'تنظيف سبام ميدياويكى',
'spam_reverting' => 'ترجيع آخر نسخة مافيهاش لينكات لـ $1',
'spam_blanking' => 'كل النسخ فيها لينكات ل $1، فضيها',
+'simpleantispam-label' => "اختبار انتي-سبام.
+'''ماتعبيش''' دا!",
# Skin names
'skinname-cologneblue' => 'كولون بلو',
'spam_reverting' => '$1লৈ সংযোগ নথকা সৰ্বশেষ পুনৰীক্ষনলে উভতাই নিয়া হৈছে',
'spam_blanking' => 'সকলো পুনৰীক্ষনৰ $1লৈ সংযোগ আছিল, ৰিক্ত কৰা হৈছে',
'spam_deleting' => 'সকলো পুনৰীক্ষণৰ $1লৈ সংযোগ আছিল, বিলোপ কৰা হৈছে',
+'simpleantispam-label' => "এণ্টি-স্পাম পৰীক্ষা।
+এইখন পূৰণ '''নকৰিব'''!",
# Info page
'pageinfo-title' => '"$1" ৰ তথ্য',
'spam_reverting' => 'Revirtiendo a la cabera versión que nun contién enllaces a $1',
'spam_blanking' => 'Toles revisiones teníen enllaces a $1; dexando en blanco',
'spam_deleting' => 'Toles revisiones teníen enllaces a $1, desaniciando',
+'simpleantispam-label' => "Control anti-spam.
+¡'''NUN''' rellenes esto!",
# Info page
'pageinfo-title' => 'Información sobro "$1"',
'spam_reverting' => '$1 һылтанмаһыҙ һуңғы өлгөгә ҡайтарыу',
'spam_blanking' => 'Бөтә өлгөләрҙә лә $1 һылтанмаһы бар, таҙартыу',
'spam_deleting' => 'Бөтә өлгөләрҙә лә $1 һылтанма бар, таҙартыу бара',
+'simpleantispam-label' => "Спамға ҡаршы тикшереү.
+Быны '''ТУЛТЫРМАҒЫҘ'''!",
# Info page
'pageinfo-title' => '«$1» буйынса мәғлүмәт',
'spambot_username' => 'اسپم پاک کنوک مدیا وی کی',
'spam_reverting' => 'عوض کتن په آهری نسحه که شامل لینکان می بیت په $1',
'spam_blanking' => 'کل بازبینی آن شامل لینکان په $1, بوتت هالیکی',
+'simpleantispam-label' => "کنترل ضد اسپم.
+ای شیء پر ''مکن''",
# Skin names
'skinname-cologneblue' => 'نیلی کولاجن',
'spam_reverting' => 'Mabalik sa huring bersion na mayong takod sa $1',
'spam_blanking' => 'An gabos na mga pahirá na may takod sa $1, pigblablanko',
'spam_deleting' => 'An gabos na mga rebisyon na igwang mga kasugpunan sa $1, pinupura',
+'simpleantispam-label' => 'Narikisa kan anti-espam.
+"Dae" ka magkaag nin laman digde!',
# Info page
'pageinfo-title' => 'Impormasyon para sa "$1"',
'spam_reverting' => 'Адкат да апошняй вэрсіі без спасылак на $1',
'spam_blanking' => 'Усе вэрсіі ўтрымліваюць спасылкі на $1, чыстка',
'spam_deleting' => 'Усе вэрсіі ўтрымлівалі спасылкі на $1, выдаляем',
+'simpleantispam-label' => "Праверка анты-спаму.
+'''НЕ''' запаўняйце тут нічога!",
# Info page
'pageinfo-title' => 'Інфармацыя пра «$1»',
'spam_reverting' => 'Връщане на последната версия, несъдържаща препратки към $1',
'spam_blanking' => 'Всички версии, съдържащи препратки към $1, изчистване',
'spam_deleting' => 'Всички версии съдържат препратки към $1, изтриване',
+'simpleantispam-label' => "Проверка за спам.
+Необходимо е да '''НЕ''' попълвате това поле!",
# Info page
'pageinfo-title' => 'Информация за "$1"',
'spam_reverting' => '$1-এর প্রতি কোন সংযোগ নেই, এমন সর্বশেষ সংস্করণে ফেরত নেওয়া হচ্ছে।',
'spam_blanking' => '$1-এর প্রতি সংযোগ অন্তর্ভুক্ত আছে এমন সমস্ত সংশোধন খালি করা হচ্ছে',
'spam_deleting' => '$1-এর প্রতি সংযোগ অন্তর্ভুক্ত আছে এমন সমস্ত সংশোধন অপসারণ করা হচ্ছে',
+'simpleantispam-label' => "এন্টি-স্প্যাম যাচাই।
+এটা পূরণ করবেন '''না'''!",
# Info page
'pageinfo-title' => '"$1" এর তথ্য',
'spam_reverting' => "Distreiñ d'ar stumm diwezhañ hep liamm davet $1",
'spam_blanking' => 'Diverkañ an holl stummoù enno liammoù davet $1',
'spam_deleting' => 'An holl stummoù enno liammoù war-zu $1, o tiverkañ',
+'simpleantispam-label' => "Taol gwiriañ eneb-strob.
+'''Arabat''' merkañ tra pe dra amañ !",
# Info page
'pageinfo-title' => 'Titouroù evit "$1"',
'spam_reverting' => 'Vraćanje na zadnju verziju koja ne sadrži linkove ka $1',
'spam_blanking' => 'Sve revizije koje sadrže linkove ka $1, očisti',
'spam_deleting' => 'Sve revizije koje sadrže linkove na $1, brišem',
+'simpleantispam-label' => "Provjera protiv spama.
+'''NE''' popunjavaj ovo!",
# Info page
'pageinfo-title' => 'Informacije za "$1"',
'spam_reverting' => 'Es reverteix a la darrera versió que no conté enllaços a $1',
'spam_blanking' => "Totes les revisions contenien enllaços $1, s'està deixant en blanc",
'spam_deleting' => "S'estan suprimint totes les revisions que contenien enllaços a $1",
+'simpleantispam-label' => "Comprovació anti-spam.
+'''NO''' ho ompliu!",
# Info page
'pageinfo-title' => 'Informació de «$1»',
'tog-noconvertlink' => 'Хааман хьажориг кхуллу гlирс дlабайа',
'tog-norollbackdiff' => 'Юха яккхиначул тӀаьхьа ма гайта версешан башхо',
'tog-useeditwarning' => 'Хаамбе бина хийцамаш дӀаязцабеш аса болх дӀатосучу хенахь',
+'tog-prefershttps' => 'Даима лела йе лардина системин чудалар',
'underline-always' => 'Даимна',
'underline-never' => 'Цкъа а',
'recentchangesdays-max' => 'Къезиг $1 {{PLURAL:$1|дена}}',
'recentchangescount' => 'Iад йитарца гойтуш долу нисдаршан дукхалла',
'prefs-help-recentchangescount' => 'Гойту керла нисдарш, агӀонашан истори, тептарш.',
+'prefs-help-watchlist-token2' => 'Иза хьан тергаме могӀан къайла догӀа ду.
+Муьлха и хуучунна йиш ю хьан тергаме могӀам беша, цундела ма хаийта иза кхечаьрга. [[Special:ResetTokens|ТӀетаӀа йе кхуза и хьайга кхосса лууш делахь]].',
'savedprefs' => 'Хьан гӀирс Ӏалашбина.',
'timezonelegend' => 'Сахьатан аса:',
'localtime' => 'Меттигера хан:',
'htmlform-selectorother-other' => 'Кхин',
# New logging system
-'logentry-delete-delete' => '$1 {{GENDER:$2|дӀаякхина|дӀаякхина}} агӀо $3',
+'logentry-delete-delete' => '$1 {{GENDER:$2|дӀаяьккхина}} агӀо $3',
'logentry-delete-restore' => '$1 {{GENDER:$2|меттахӀоттайина|меттахӀоттайина}} агӀо $3',
'logentry-move-move' => '$1 {{GENDER:$2|цӀе хийцина|цӀе хийцина}} $3 оцу $4',
'logentry-move-move-noredirect' => '$1 {{GENDER:$2|цӀе хийцина|цӀе хийцина}} $3 оцу $4 дӀасахьажийнарг цаюьтуш',
'spam_reverting' => 'Revert na poslední verzi neobsahující odkazy na $1',
'spam_blanking' => 'Všechny verze obsahovaly odkazy na $1, vyprázdněno',
'spam_deleting' => 'Všechny verze obsahovaly odkazy na $1, smazáno',
+'simpleantispam-label' => "Antispamová kontrola.
+'''NEVYPLŇUJTE''' následující!",
# Info page
'pageinfo-title' => 'Informace o stránce „$1“',
'spam_reverting' => 'Wedi adfer y diwygiad diweddaraf na sydd yn cynnwys cysylltiadau i $1',
'spam_blanking' => 'Roedd cysylltiadau i $1 gan bob golygiad, felly gwacawyd y dudalen',
'spam_deleting' => 'Roedd pob diwygiad yn cynnwys cysylltiadau â $1, felly fe ddilëwyd y dudalen',
+'simpleantispam-label' => "Prawf gwrth-sbam.
+'''Peidiwch''' â llenwi hwn!",
# Info page
'pageinfo-title' => 'Manylion "$1"',
* @author Morten LJ
* @author Najami
* @author Nghtwlkr
+ * @author Overlaet
* @author Palnatoke
* @author Peter Alberti
* @author Peter Andersen
'spam_reverting' => 'Sidste version uden henvisning til $1 gendannet.',
'spam_blanking' => 'Alle versioner, som indeholdt henvisninger til $1, er renset.',
'spam_deleting' => 'Alle versioner indeholder henvisninger til $1, sletter',
+'simpleantispam-label' => "Anti-spam tjek.
+Udfyld ''' ikke ''' dette!",
# Info page
'pageinfo-title' => 'Information om "$1"',
'spam_reverting' => 'Letzte Version ohne Links zu $1 wiederhergestellt.',
'spam_blanking' => 'Alle Versionen mit einem Link zu $1 wurden bereinigt.',
'spam_deleting' => 'Alle Versionen mit einem Link zu $1 wurden gelöscht.',
+'simpleantispam-label' => "Spamschutzprüfung.
+Hier '''NICHTS''' eintragen!",
# Info page
'pageinfo-title' => 'Informationen zu „$1“',
'spam_reverting' => 'agêriyeno revizyon o ke tawayê $1 ıney piya çiniyo',
'spam_blanking' => 'Revizyonê gredê $1 vineyay, wa weng kero',
'spam_deleting' => 'Revizyonê gredê $1 vineyay, wa besterneyê',
+'simpleantispam-label' => "tehqiqatê Anti-spami.
+no '''de mekerê'''!",
# Info page
'pageinfo-title' => 'Heq tê "$1"\'i',
'spam_reverting' => 'Nawrośijo se slědna wersija, kótaraž njejo wopśimjeła wótkaz na $1.',
'spam_blanking' => 'Wšykne wersije su wopśimowali wótkaze na $1, do rěcha spórane.',
'spam_deleting' => 'Wšykne wersije z wótkazami do $1 so lašuju',
+'simpleantispam-label' => "Antispamowa kontrola.
+How '''NIC''' zapisaś!",
# Info page
'pageinfo-title' => 'Informacije za bok "$1"',
'spam_reverting' => 'Επαναφορά στην τελευταία έκδοση που δεν περιέχει συνδέσμους στο $1',
'spam_blanking' => 'Όλες οι αναθεωρήσεις περιείχαν συνδέσμους προς το $1, εξάλειψη',
'spam_deleting' => 'Διαγραφή όλων των αναθεωρήσεων που περιείχαν συνδέσμους προς το $1',
+'simpleantispam-label' => "Έλεγχος anti-spam.
+'''ΜΗΝ''' το συμπληρώσετε αυτό!",
# Info page
'pageinfo-title' => 'Πληροφορίες για "$1"',
'broken-file-category' => 'Pages with broken file links',
'categoryviewer-pagedlinks' => '($1) ($2)', # only translate this message to other languages if you have to change it
-'linkprefix' => '/^(.*?)([a-zA-Z\\x80-\\xff]+)$/sD', # only translate this message to other languages if you have to change it
+'linkprefix' => '/^((?>.*(?<![a-zA-Z\\x80-\\xff])))(.+)$/sD', # only translate this message to other languages if you have to change it
'about' => 'About',
'article' => 'Content page',
'spam_reverting' => 'Reverting to last revision not containing links to $1',
'spam_blanking' => 'All revisions contained links to $1, blanking',
'spam_deleting' => 'All revisions contained links to $1, deleting',
+'simpleantispam-label' => "Anti-spam check.
+Do '''NOT''' fill this in!",
# Info page
'pageinfo-header' => '-', # do not translate or duplicate this message to other languages
'spam_reverting' => 'Restarigo de lasta versio ne entenante ligilojn al $1',
'spam_blanking' => 'Forviŝo de ĉiuj versioj entenantaj ligilojn al $1',
'spam_deleting' => 'Ĉiuj versioj enhavis ligilojn al $1 - forigante',
+'simpleantispam-label' => 'Kontrolo kontraŭ spamo.
+NE ENIGU ion ajn!',
# Info page
'pageinfo-title' => 'Informoj por "$1"',
'spam_reverting' => 'Revirtiendo a la última versión que no contenga enlaces a $1',
'spam_blanking' => 'Todas las revisiones contienen enlaces a $1, blanqueando',
'spam_deleting' => 'Todas las revisiones que contienen enlaces a $1, en proceso de eliminación',
+'simpleantispam-label' => 'Comprobación anti-spam
+¡NO rellenes esto!',
# Info page
'pageinfo-title' => 'Información para «$1»',
'spam_reverting' => 'Taastan viimase versiooni, mis ei sisalda linke aadressile $1.',
'spam_blanking' => 'Kõik versioonid sisaldasid linke veebilehele $1. Lehekülg tühjendatud.',
'spam_deleting' => 'Kustutatud kõik redaktsioonid, mis viitasid aadressile $1.',
+'simpleantispam-label' => "Rämpspostikontroll.
+'''ÄRA''' täida seda välja!",
# Info page
'pageinfo-title' => 'Teave lehekülje "$1" kohta',
'spambot_username' => 'MediaWikiren spam garbiketa',
'spam_reverting' => '$1(e)rako loturarik ez daukan azken bertsiora itzultzen',
'spam_blanking' => 'Berrikuspen guztiek $1(e)rako lotura zeukaten, husten',
+'simpleantispam-label' => "Anti-spam egiaztapena.
+Atal hau '''EZ''' bete!",
# Info page
'pageinfo-title' => '"$1"(r)entzako informazioa',
'uploadstash-nofiles' => 'شما هیچ پروندهٔ انبارشدهای ندارید.',
'uploadstash-badtoken' => 'انجام این اقدام ناموفق بود، احتمالاً به این دلیل که اعتبار ویرایش شما به اتمام رسیده است. دوباره امتحان کنید.',
'uploadstash-errclear' => 'پاک کردن پروندهها ناموفق بود.',
-'uploadstash-refresh' => 'تازه کردن فهرست پروندهها',
+'uploadstash-refresh' => 'تازهکردن فهرست پروندهها',
'invalid-chunk-offset' => 'جابجایی نامعتبر قطعه',
# img_auth script messages
'spam_reverting' => 'واگردانی به آخرین نسخهای که پیوندی به $1 ندارد.',
'spam_blanking' => 'تمام نسخهها حاوی پیوند به $1 بود، در حال خالی کردن',
'spam_deleting' => 'تمام نسخهها حاوی پیوند به $1 بود، در حال حذف',
+'simpleantispam-label' => "بررسی ضدهرزنگاری.
+این قسمت را پر '''نکنید'''!",
# Info page
'pageinfo-title' => 'اطلاعات در مورد «$1»',
'spam_reverting' => 'Palautettu viimeisimpään versioon, joka ei sisällä linkkejä kohteeseen $1.',
'spam_blanking' => 'Kaikki versiot sisälsivät linkkejä kohteeseen $1. Sivu tyhjennetty.',
'spam_deleting' => 'Kaikki versiot sisälsivät linkkejä kohteeseen $1, poistetaan',
+'simpleantispam-label' => "Mainostenvastainen tarkistus. '''ÄLÄ''' täytä tätä!",
# Info page
'pageinfo-title' => 'Tietoja sivusta $1',
'spam_reverting' => 'Rétablissement de la dernière version ne contenant pas de lien vers $1',
'spam_blanking' => 'Toutes les versions contenant des liens vers $1 sont blanchies',
'spam_deleting' => 'Toutes les versions contenaient des liens vers $1, suppression',
+'simpleantispam-label' => "Vérification anti-spam.
+Ne '''RIEN''' inscrire ici !",
# Info page
'pageinfo-title' => 'Informations pour « $1 »',
'spam_reverting' => 'Rètablissement de la dèrriére vèrsion que contint gins de lim de vers $1',
'spam_blanking' => 'Totes les vèrsions que contegnont des lims de vers $1 sont blanchies',
'spam_deleting' => 'Totes les vèrsions que contegnont des lims de vers $1 sont suprimâs',
+'simpleantispam-label' => "Contrôlo anti-spame.
+Enscrîde '''REN''' ique !",
# Info page
'pageinfo-title' => 'Enformacions por « $1 »',
'spam_reverting' => 'Revertida á última edición sen ligazóns a "$1"',
'spam_blanking' => 'Limpáronse todas as revisións con ligazóns a "$1"',
'spam_deleting' => 'Borráronse todas as revisións con ligazóns a "$1"',
+'simpleantispam-label' => "Comprobación antispam.
+'''NON''' encha isto!",
# Info page
'pageinfo-title' => 'Información sobre "$1"',
'spam_reverting' => 'Letschti Version ohni Links zue $1 widerhärgstellt.',
'spam_blanking' => 'In allene Versione het s Links zue $1 gha, sufer gmacht.',
'spam_deleting' => 'Alli Versione mit eme Link zue $1 sin glescht woret.',
+'simpleantispam-label' => "Spamschutz-Priefig. Do '''nyt''' yytrage!",
# Info page
'pageinfo-title' => 'Informatione zue „$1“',
'spambot_username' => 'મિડિયાવિકી સ્પેમ સફાઇ',
'spam_reverting' => ' $1 પર કડી ન ધરાવતા છેલ્લા ફેરેફાર પર પુનઃ સ્થાપન કરાય છે',
'spam_blanking' => 'બધા ફેરફારોમાં $1 પર કડી હતી, આને હટાવી દેવામાં આવે છે',
+'simpleantispam-label' => "સ્પૅમ વિરોધી તપાસ.
+આને '''ન''' ભરશો!",
# Info page
'pageinfo-title' => ' "$1" માટે માહિતી',
'spam_reverting' => 'שחזור לגרסה אחרונה שלא כוללת קישורים ל־$1',
'spam_blanking' => 'כל הגרסאות כוללות קישורים ל־$1, מרוקן את הדף',
'spam_deleting' => 'כל הגרסאות כוללות קישורים ל־$1, מוחק את הדף',
+'simpleantispam-label' => "בדיקת אנטי־ספאם.
+'''אל''' תמלאו שדה זה!",
# Info page
'pageinfo-title' => 'מידע על "$1"',
'spam_reverting' => '$1 को कड़ी ना होने वाले पुराने अवतरण को पुनर्स्थापित कर रहें हैं',
'spam_blanking' => 'सभी अवतरणोंमें $1 को कड़ियां हैं, पूरा पाठ निकाल रहें हैं',
'spam_deleting' => 'सभी अवतरणों में $1 की कड़ी थी, हटाया जा रहा है',
+'simpleantispam-label' => "ऍन्टी-स्पैम जाँच.
+इसे भरें '''नहीं'''!",
# Info page
'pageinfo-title' => '"$1" के लिये जानकारी',
'recentchangesdays-max' => '(maksimalno $1 {{PLURAL:$1|dan|dana}})',
'recentchangescount' => 'Zadani broj izmjena koje se prikazuju:',
'prefs-help-recentchangescount' => 'Ovo uključuje nedavne promjene, stare izmjene, i evidencije.',
+'prefs-help-watchlist-token2' => 'Ovo je tajni ključ prema sažetku vašeg popisa praćenja. Svaki suradnik kojem je poznat, moći će čitati vaš popis praćenih stranica. Ne dijelite ga ni s kim. [[Special:ResetTokens|Kliknite ovdje ako ga želite ponovo postaviti]].',
'savedprefs' => 'Vaše postavke su sačuvane.',
'timezonelegend' => 'Vremenska zona:',
'localtime' => 'Lokalno vrijeme:',
'spam_reverting' => 'Vraćam na zadnju inačicu koja ne sadrži poveznice na $1',
'spam_blanking' => 'Sve inačice sadrže poveznice na $1, brišem cjelokupni sadržaj',
'spam_deleting' => 'Sve inačice sadržale su poveznice na $1, brišem cjelokupni sadržaj',
+'simpleantispam-label' => "Anti-spam provjera.
+'''Ne''' ispunjavajte ovo!",
# Info page
'pageinfo-title' => 'Podatci o stranici "$1"',
'spam_reverting' => 'wróćo na poslednju wersiju, kotraž wotkazy na $1 njewobsahuje',
'spam_blanking' => 'Wšě wersije z wotkazami do $1 so porjedźeja',
'spam_deleting' => 'Wšě wersije z wotkazami do $1 so zhašeja',
+'simpleantispam-label' => "Kontrola přećiwo spamej.
+Tu '''ničo''' njezapisać!",
# Info page
'pageinfo-title' => 'Informacije za stronu "$1"',
'spam_reverting' => 'Visszatérés a $1 lapra mutató hivatkozásokat nem tartalmazó utolsó változathoz',
'spam_blanking' => 'Az összes változat tartalmazott a $1 lapra mutató hivatkozásokat, kiürítés',
'spam_deleting' => 'Minden változat tartalmazott $1-re mutató hivatkozást, törlöm',
+'simpleantispam-label' => "Spam elleni ellenőrzés.
+'''NE''' töltsd ezt ki!",
# Info page
'pageinfo-title' => 'Információk a(z) „$1” lapról',
'spam_reverting' => 'Revertite al ultime version que non contine ligamines a $1',
'spam_blanking' => 'Tote le versiones contineva ligamines a $1. Le pagina es vacuate.',
'spam_deleting' => 'Tote le versiones contineva ligamines a $1. Le pagina es delite.',
+'simpleantispam-label' => "Verification antispam.
+'''NON''' completa isto!",
# Info page
'pageinfo-title' => 'Informationes pro "$1"',
'spam_reverting' => 'Membatalkan ke versi terakhir yang tak memiliki pranala ke $1',
'spam_blanking' => 'Semua revisi yang memiliki pranala ke $1, kosong',
'spam_deleting' => 'Semua revisi yang memiliki pranala ke $1, penghapusan',
+'simpleantispam-label' => "Pemeriksaan anti-spam.
+Masukan ini '''DILARANG'''!",
# Info page
'pageinfo-title' => 'Informasi untuk "$1"',
'articlepage' => 'Kitaen ti naglaon a panid',
'talk' => 'Pagtungtungan',
'views' => 'Dagiti pangkitaan',
-'toolbox' => 'Kahon ti ramit',
+'toolbox' => 'Ramramit',
'userpage' => 'Kitaen ti panid ti agar-aramat',
'projectpage' => 'Kitaen ti panid ti gandat',
'imagepage' => 'Kitaen ti panid ti papeles',
'userlogin-resetpassword-link' => 'Iyasentar manen ti kontrasenias',
'helplogin-url' => 'Help:Panagserrek',
'userlogin-helplink' => '[[{{MediaWiki:helplogin-url}}|Tulong iti panagserrek]]',
+'userlogin-loggedin' => 'Nakastrekkan a kas ni {{GENDER:$1|$1}}.
+Usaren ti porma dita baba tapno sumrek a kas sabali nga agar-aramat.',
+'userlogin-createanother' => 'Agaramid pay ti sabali a pakabilangan',
'createacct-join' => 'Ikabil ti pakaammom dita baba.',
'createacct-another-join' => 'Ikabil ti pakaammo ti baro a pakabilangan dita baba.',
'createacct-emailrequired' => 'Esurat a pagtaengan',
'deletecomment' => 'Rason:',
'deleteotherreason' => 'Sabali/maipatinayon a rason:',
'deletereasonotherlist' => 'Sabali a rason',
-'deletereason-dropdown' => '*Kadawyan a rasrason ti panagikkat
-** Kiddaw ti mannurat
+'deletereason-dropdown' => '* Kadawyan a rasrason ti panagikkat
+** Spam
+** Bandalismo
** Panaglabsing iti karbengan ti panagipablaak
-** Bandalismo',
+** Kiddaw ti mannurat
+** Naputed a baw-ing',
'delete-edit-reasonlist' => 'Urnosen dagiti rason ti panagikkat',
'delete-toobig' => 'Daytoy a panid ket dakkel ti pakasaritaanna, sumurok a $1 {{PLURAL:a panagbaliwan|dagiti panagbaliwan}}.
Ti panagikkat ti kastoy a pammpanid ket naparitan tapno mapawilan ti saan nga inkarkaro a pannakadadael ti {{SITENAME}}.',
'spam_reverting' => 'Ipasubli ti kinaudi a panagbaliw nga awan dagiti linaon a silpo idiay $1',
'spam_blanking' => 'Dagiti amin a panagbaliw ket aglaon kadagiti silpo idiay $1, iblanko',
'spam_deleting' => 'Dagiti amin a panagbaliw ket naglaon kadagiti silpo idiay $1, ik-ikkaten',
+'simpleantispam-label' => "Kontra-spam a panagkita.
+ '''Saan''' mo a suratan daytoy!",
# Info page
'pageinfo-title' => 'Pakaammo para iti "$1"',
'spam_reverting' => 'Tek aftur síðustu breytingu sem inniheldur ekki tengil á $1',
'spam_blanking' => 'Allar útgáfur innihéldu tengla á $1, tæmi síðuna',
'spam_deleting' => 'Allar útgáfur innihéldu tengla á $1, eyði síðunni',
+'simpleantispam-label' => 'Kæfuvörn.
+Ekki fylla þetta út!',
# Info page
'pageinfo-title' => 'Upplýsingar um $1',
'spam_reverting' => "Ripristinata l'ultima versione priva di collegamenti a $1",
'spam_blanking' => 'Pagina svuotata, tutte le versioni contenevano collegamenti a $1',
'spam_deleting' => 'Pagina cancellata, tutte le versioni contenevano collegamenti a $1',
+'simpleantispam-label' => "Controllo anti-spam.
+'''NON''' riempire!",
# Info page
'pageinfo-title' => 'Informazioni per "$1"',
'spam_reverting' => '$1へのリンクを含まない最新の版に差し戻し',
'spam_blanking' => 'すべての版が$1へのリンクを含んでいます。白紙化します。',
'spam_deleting' => 'すべての版が$1へのリンクを含んでいます。削除します。',
+'simpleantispam-label' => "SPAM防止チェックです。
+決してここに値を入力'''しない'''でください。",
# Info page
'pageinfo-title' => '「$1」の情報',
'spam_reverting' => 'Mbalèkaké menyang vèrsi pungkasan sing ora ana pranalané menyang $1',
'spam_blanking' => 'Kabèh révisi sing duwé pranala menyang $1, pangosongan',
'spam_deleting' => 'Kabèh benahan sing nduwé pranala nèng $1, dibusaki',
+'simpleantispam-label' => "Pamariksan anti-spam.
+'''Aja''' diisèkaké!",
# Info page
'pageinfo-title' => 'Inpormasi kanggo "$1"',
'spam_reverting' => 'დაბრუნება ბოლო ვერსიასთან, რომელიც არ შეიცავს ბმულს $1-თან',
'spam_blanking' => 'ყველა გვერდი შეიცავს ბმულს $1-გვერდზე. გასუფთავება',
'spam_deleting' => 'ყველა ვერსია შეიცავდა ბმულს $1-ზე, მიმდინარეობს წაშლა',
+'simpleantispam-label' => "ანტი-სპამის შემოწმება.
+'''არ''' შეავსოთ ის!",
# Info page
'pageinfo-title' => 'ინფორმაცია „$1“-თვის',
'spam_reverting' => '$1(을)를 포함하지 않는 최신 버전으로 되돌림',
'spam_blanking' => '모든 버전에 $1 링크를 포함하고 있어 차단함',
'spam_deleting' => '모든 버전에 $1 링크를 포함하고 있어 삭제함',
+'simpleantispam-label' => "스팸 방지 검사입니다.
+이것을 입력하지 '''마세요'''!",
# Info page
'pageinfo-title' => '"$1" 문서에 대한 정보',
'spam_reverting' => 'De letzte Version ohne de Links op „$1“ widder zerröckjehollt.',
'spam_blanking' => 'All die Versione hatte Links op „$1“, die sin jetz erus jemaht.',
'spam_deleting' => 'All di Versione met Lenks op „$1“ wääde fott jeschmeße',
+'simpleantispam-label' => 'SPAMschotz — donn hee nix endraare!',
# Info page
'pageinfo-title' => 'Övver di Sigg: „$1“',
'spam_reverting' => 'Déi lescht Versioun ouni Linken op $1 restauréieren.',
'spam_blanking' => 'An alle Versioune ware Linken op $1, et ass elo alles gebotzt.',
'spam_deleting' => 'All Versioune mat Linken op $1 gi geläscht',
+'simpleantispam-label' => "Anti-Spam Kontroll.
+Fëllt '''näischt''' hei ënnendrënner aus!",
# Info page
'pageinfo-title' => 'Informatioun iwwer "$1"',
'spam_reverting' => 'Bezig mit trökdrèjje nao de letste versie die gein verwiezing haet nao $1',
'spam_blanking' => "Alle wieziginge mit 'ne link nao $1 waere verwiederd",
'spam_deleting' => 'Alle wieziginge hawwe links nao $1, wuuertj gewösj',
+'simpleantispam-label' => "Antispemcontrole.
+Vol dit veld '''NEET''' in!",
# Info page
'pageinfo-title' => 'Informatie euver "$1"',
'spam_reverting' => 'Atkuriama į ankstesnę versiją, neturinčios nuorodų į $1',
'spam_blanking' => 'Visos versijos turėjo nuorodų į $1, išvaloma',
'spam_deleting' => 'Visos versijos turėjo nuorodų į $1, ištrinama',
+'simpleantispam-label' => "Anti-spam patikra.
+'''NE'''pildykite!",
# Info page
'pageinfo-title' => '„$1“ informacija',
'spamprotectionmatch' => 'Spama filtram radās iebildumi pret šo tekstu: $1',
'spambot_username' => 'MediaWiki surogātpasta tīrīšana',
'spam_reverting' => 'Atjauno iepriekšējo versiju, kas nesatur saiti uz $1',
+'simpleantispam-label' => "Pretspama pārbaude.
+ '''NEAIZPILDĪT!'''",
# Info page
'pageinfo-title' => 'Informācija par "$1"',
'userlogin-resetpassword-link' => 'Hamerina ny tenimiafinao',
'helplogin-url' => 'Help:Fidirana',
'userlogin-helplink' => '[[{{MediaWiki:helplogin-url}}|Fanoroana mikasika ny fidirana]]',
+'userlogin-createanother' => 'Hamorona kaonty hafa',
'createacct-join' => 'Atsofohy eo ambany ny fampahalalana momba anao.',
'createacct-another-join' => "Atsofohy eo ambany ny fampahalalana vaovaon'ny kaonty",
'createacct-emailrequired' => 'Adiresy mailaka :',
'listfiles_size' => 'Habe',
'listfiles_description' => 'Visavisa',
'listfiles_count' => 'Version',
+'listfiles-latestversion' => 'Filaza ankehitriny',
'listfiles-latestversion-yes' => 'Eny',
'listfiles-latestversion-no' => 'Tsia',
'morelinkstoimage' => "Hijery [[Special:WhatLinksHere/$1|rohy fanampiny]] makany amin'io rakitra io.",
'linkstoimage-redirect' => '$1 (fihodinana) $2',
'sharedupload' => "Mety ho rakitra itambarana amin'ny tetikasa hafa ny rakitra $1.",
+'sharedupload-desc-there' => "Avy amin'i $1 ity rakitr aity ary mety ampiasaina any amin'ny tetikasa hafa.
+Jereo [$2 ny pejy famisavisana ilay rakitra] ho an'ny fampahalalana fanampiny.",
'sharedupload-desc-here' => "Avy amin'i $1 io rakitra io ary mety ampiasain'ny tetikasa hafa.
Aseho eo ambany ny [$2 famisavisana ilay rakitra].",
+'sharedupload-desc-edit' => "Avy amin'i $1 ity rakitra ity ka mety ampiasaina any amina tetikasa hafa.
+Mety tia hanova ny famisavisany ianao any amin'ny [$2 pejy famisavisana rakitra] any.",
'filepage-nofile' => 'Tsy nahitana rakitra mitondra io anarana io.',
'filepage-nofile-link' => 'Tsy misy rakitra mitondra io anarana io, fa afaka [$1 mampiditra azy ianao].',
'uploadnewversion-linktext' => "Andefa version vaovao n'ity rakitra ity",
Efa nataon'i [[User:$3|$3]] ([[User talk:$3|dinika]]{{int:pipe-separator}}[[Special:Contributions/$3|{{int:contribslink}}]]) ny fanovana farany.",
'editcomment' => "Toy izao no fanamarihana momba io fanovana io: \"''\$1''\".",
'revertpage' => "Voafafa ny fanovana ny [[Special:Contributions/$2|$2]] ([[User talk:$2|Dinika]]); voaverina amin'ny votoatiny teo aloha nataon'i [[User:$1|$1]]",
-'revertpage-nouser' => "Manala ny fanovana (nataon'ny anaram-pikambana nesorina), miverina any amin'ny santiona farany nataon'i [[User:$1|$1]]",
+'revertpage-nouser' => "Manala ny fanovana (nataom-pikambana voaafina), miverina any amin'ny filaza faran'i [[User:$1|$1]]",
'rollback-success' => "Fanalàna ny fanovana nataon'i $1 ;
miverina any amin'ny santiôna farany nataon'i $2.",
'unprotectedarticle' => "nanala ny fiarovana an'i « [[$1]] »",
'movedarticleprotection' => 'nanova ny safidim-piarovana : « [[$2]] » lasa « [[$1]] »',
'protect-title' => "Hanova ny lentam-piarovana ho an'i « $1 »",
-'protect-title-notallowed' => "Hijery ny lentam-piarovana ho an'i «[[$1]]»",
+'protect-title-notallowed' => "Hijery ny lentam-piarovana ho an'i «$1»",
'prot_1movedto2' => '[[$1]] voaova anarana ho [[$2]]',
'protect-badnamespace-title' => 'Anaran-tsehatra tsy azo arovana',
'protect-badnamespace-text' => "Tsy afaka arovana ny pejy ao amin'io anaran-tsehatra io.",
# JavaScriptTest
'javascripttest' => 'Fanandramana JavaScript',
'javascripttest-title' => 'Mandefa fanandramana $1',
+'javascripttest-pagetext-skins' => 'Mifidia skin hanaovana ny fanandramana:',
+'javascripttest-qunit-intro' => "Jereo ny [$1 fanoroana mikasika ny andrana] eo amin'i mediawiki.org.",
+'javascripttest-qunit-heading' => "Tohin'andrana QUnit an'i Javascript eo amin'i MediaWiki",
# Tooltip help for the actions
'tooltip-pt-userpage' => 'Ny pejinao',
'tooltip-ca-viewsource' => 'Voaaro ilay pejy. Fa afaka itanao ny voatotiny.',
'tooltip-ca-history' => "Ny revision natao tamin'ity pejy ity",
'tooltip-ca-protect' => 'Arovy ity pejy ity',
-'tooltip-ca-unprotect' => "Hanala ny fiarovan'ity pejy ity",
+'tooltip-ca-unprotect' => "Hanova ny lentam-piarovan'ity pejy ity",
'tooltip-ca-delete' => 'Fafao ity pejy ity',
'tooltip-ca-undelete' => "Hamerina ny fanovana natao tamin'ity pejy ity talohan'ny famafany",
'tooltip-ca-move' => 'Ovay anarana ilay pejy',
'othercontribs' => "Mifototra amin'ny asan'i $1.",
'others' => 'hafa',
'siteusers' => '{{SITENAME}} mpikambana $1 miisa $2{{PLURAL:}}',
-'anonusers' => "Ny mpikambana tsy nisoratra anarana $1 ao amin'i {{SITENAME}}",
+'anonusers' => "Ny mpikambana tsy nisoratra anarana $1 ao amin'i {{SITENAME}}{{PLURAL:$2}}",
+'creditspage' => "Fisaorana ho an'ny pejy",
# Spam protection
'spamprotectiontitle' => "Sivana mpiaro amin'ny spam",
'pageinfo-length' => 'Halavam-pejy (oktety)',
'pageinfo-article-id' => 'Laharam-pejy',
'pageinfo-language' => "Tenin'ny votoatiny",
-'pageinfo-robot-policy' => "Satan'ny motera fikarohana",
-'pageinfo-robot-index' => 'Azo tondroina',
+'pageinfo-robot-policy' => "Fanondroana ataon'ny rôbô",
+'pageinfo-robot-index' => 'Azo atao',
'pageinfo-robot-noindex' => 'Tsy azo tondroina',
'pageinfo-views' => "Isan'ny jery",
'pageinfo-watchers' => "Isan'ny mpandray anjara manaraka",
+'pageinfo-few-watchers' => 'Mpanaraka latsaky ny $1{{PLURAL:}}',
'pageinfo-redirects-name' => "Fihodinana manketo amin'ity pejy ity",
'pageinfo-subpages-name' => "Zana-pejin'ity pejy ity",
'pageinfo-firstuser' => 'Mpamorona ilay pejy',
'markedaspatrollederrortext' => 'Tsy maintsy misafidy santiôna iray ianao mba hahafahanao manamarika azy ho voamarina.',
'markedaspatrollederror-noautopatrol' => 'Tsy azonao marihana ho voamarina ny fanovanao.',
'markedaspatrollednotify' => "Voamarika ho hita ny fanovana natao tamin'i $1.",
+'markedaspatrollederrornotify' => 'Tsy nahamarika azy ho voaara-maso.',
# Patrol log
'patrol-log-page' => "Laogin'ny fanovana voamarina",
'exif-gpsdestlatitude' => 'Laharam-pehintany tanjona',
'exif-gpsareainformation' => 'Anaram-paritra GPS',
'exif-gpsdatestamp' => 'Daty GPS',
+'exif-worldregioncreated' => 'Faritany nangalana ity ilay sary',
'exif-countrycreated' => 'Firenena nangalana ilay sary',
+'exif-countrycodecreated' => 'Kaontim-pirenena nangalana ilay sary',
+'exif-provinceorstatecreated' => 'Faritany nangalana ilay sary',
+'exif-citycreated' => 'Tanàna nangalana ilay sary',
+'exif-sublocationcreated' => 'Fari-tanàna nangalana ilay sary',
'exif-worldregiondest' => 'Faritany aseho',
'exif-countrydest' => 'Firenena aseho',
'exif-countrycodedest' => 'Kaodim-pirenena aseho',
'exif-contact' => 'Fampahalalana mikasika ny fifandraisana',
'exif-writer' => 'Mpanoratra',
'exif-languagecode' => 'Fiteny',
+'exif-iimversion' => 'filaza IIM',
'exif-iimcategory' => 'Sokajy',
'exif-iimsupplementalcategory' => 'Sokajy fanampiny',
'exif-datetimeexpires' => 'Asa ampiasaina aoriany',
'exif-attributionurl' => "Rehefa mampiasa ity asa ity dia asio rohy mankany amin'i",
'exif-preferredattributionname' => 'Rehefa mampiasa ilay asa, isaory',
'exif-pngfilecomment' => "Famoahan-kevitra momban'ilay rakitra PNG",
+'exif-disclaimer' => 'Fampitanremana',
'exif-contentwarning' => 'Fampitandremana mikasika ny votoatiny',
'exif-giffilecomment' => 'Famoahan-kevitry ny rakirta GIF',
'exif-intellectualgenre' => 'Karazan-javatra',
+'exif-subjectnewscode' => "Kaodin'ny lohahevitra",
+'exif-event' => 'Zava-mitranga azo sary',
+'exif-organisationinimage' => 'Fikambanana azo sary',
+'exif-personinimage' => 'Olona azo sary',
+'exif-originalimageheight' => "Haambon-tsary talohan'ny nanovana azy",
'exif-copyrighted-true' => "Iharan'ny zom-pamorona",
'exif-copyrighted-false' => "Toetran'ny zom-pamorona tsy voafaritra",
'exif-unknowndate' => 'Daty tsy fantatra',
'exif-orientation-1' => 'Tsotra',
+'exif-orientation-3' => 'Ahodina 180°',
+'exif-orientation-4' => 'Navadika ambony ambany',
+'exif-orientation-5' => 'Navadika 90° miankavia ary navadika ambony ambany',
+'exif-orientation-6' => 'Navadika 90° miankavia',
+'exif-orientation-7' => 'Navadika 90° miankavanana ary navadika ambony ambany',
+'exif-orientation-8' => 'Navadika 90° miankavanana',
+
+'exif-planarconfiguration-2' => 'Data misaraka',
'exif-componentsconfiguration-0' => 'tsy nahitana',
'exif-exposureprogram-0' => 'Tsy nolazaina',
+'exif-exposureprogram-1' => 'Natao tanana',
+'exif-exposureprogram-2' => 'Fandaharana ara-dalàna',
'exif-subjectdistance-value' => '$1 metatra',
'exif-lightsource-9' => "Toetr'andro mazava",
'exif-lightsource-10' => "Toetr'andro mandrahona",
'exif-lightsource-11' => 'Haloka',
+'exif-lightsource-17' => 'Jiro manara-penitra A',
+'exif-lightsource-18' => 'Jiro manara-penitra B',
+'exif-lightsource-19' => 'Jiro manara-penitra C',
+'exif-lightsource-24' => "Tangistenina ISO an'ny studio",
+'exif-lightsource-255' => 'Loharanon-kazavana hafa',
# Flash modes
+'exif-flash-fired-0' => 'Tsy nirehitra ny flash',
+'exif-flash-fired-1' => 'Nirehitra ny flash',
+'exif-flash-return-0' => 'Tsy misy stirôbôskôpy mamerina lefa fahitana',
'exif-flash-mode-3' => 'Toetra aotômatika',
'exif-focalplaneresolutionunit-2' => 'Posy',
'confirm_purge_button' => 'Eka',
'confirm-purge-top' => "Fafana ve ny cache-n'ity pejy ity?",
+# action=watch/unwatch
+'confirm-watch-top' => 'Hanaraka ity pejy ity?',
+'confirm-unwatch-button' => 'OK',
+'confirm-unwatch-top' => "Hanala ity pejy ity amin'ny lisitry ny pejy arahinao?",
+
# Multipage image navigation
'imgmultipageprev' => '← pejy nialoha',
'imgmultipagenext' => 'pejy manaraka →',
'table_pager_first' => 'Pejy voalohany',
'table_pager_last' => 'Pejy farany',
'table_pager_limit' => 'Haneho zavatra $1 isaky ny pejy',
+'table_pager_limit_label' => 'Valiny isam-pejy:',
'table_pager_limit_submit' => 'Hitsidika',
'table_pager_empty' => 'Tsy nahitana valiny',
'watchlistedit-noitems' => 'Tsy misy lohateny ny lisitrao.',
'watchlistedit-normal-title' => 'Hanova ny lisitra ny pejy arahako maso',
'watchlistedit-normal-legend' => "Hanala lohateny ao amin'ny lisitra",
+'watchlistedit-normal-explain' => "Aseho eo ambany ny lohateny ao amin'ny lisitry ny pejy arahanao.
+Tsindrio ny boaty eo akaikiny ary tsindrio « {{int:Watchlistedit-normal-submit}} ».
+Azonao atao ihany koa ny [[Special:EditWatchlist/raw|manova ilay lisitra amin'ny akorany]].",
'watchlistedit-normal-submit' => 'Hanala ireo lohateny nosafidiana ireo',
+'watchlistedit-normal-done' => "Afaka tamin'ny lisitry ny pejy arahanao ny lohateny $1{{PLURAL:}}",
'watchlistedit-raw-title' => "Hanova ny lisitra ny pejy arahako maso amin'ny fomba akorany",
'watchlistedit-raw-legend' => "Fanovana ilay lisitry ny pejy arahina maso amin'ny fomba akorany",
'watchlistedit-raw-titles' => 'Lohateny :',
'version-hook-subscribedby' => "Nalefan'i",
'version-version' => '(Santiôna $1)',
'version-license' => 'Lisansy',
+'version-poweredby-others' => 'hafa',
'version-software' => 'Rindrankahy voapetraka',
'version-software-product' => 'Vokatra',
'version-software-version' => 'Santiôna',
# Spam protection
'spam_blanking' => 'Sado revisi nan ado pautan ka $1, kosong',
'spam_deleting' => 'Sado revisi nan ado pautan ka $1, dihapuih',
+'simpleantispam-label' => "Pamarisoan anti-spam.
+Masukan ko '''DILARANG'''!",
# Info page
'pageinfo-title' => 'Informasi untuak "$1"',
'spam_reverting' => 'Враќам на последната верзија што не содржи врска до $1',
'spam_blanking' => 'Сите ревизии содржеа врски до $1. Чистам',
'spam_deleting' => 'Сите ревизии содржеа врски до $1. Бришам',
+'simpleantispam-label' => "Антиспам проверка.
+'''НЕ''' го пополнувајте ова!",
# Info page
'pageinfo-title' => 'Информации за „$1“',
'spam_reverting' => '$1 എന്നതിലേയ്ക്കുള്ള കണ്ണികളില്ലാത്ത അവസാന നാൾപ്പതിപ്പിലേയ്ക്ക് മുൻപ്രാപനം ചെയ്യുന്നു',
'spam_blanking' => '$1 എന്നതിലേയ്ക്ക് കണ്ണികളുള്ള എല്ലാ നാൾപ്പതിപ്പുകളും ശൂന്യമാക്കുന്നു',
'spam_deleting' => '$1 എന്നതിലേയ്ക്ക് കണ്ണികളുള്ള എല്ലാ നാൾപ്പതിപ്പുകളും മായ്ക്കുന്നു',
+'simpleantispam-label' => "സ്പാം വിരുദ്ധ പരിശോധന.
+ഇത് '''പൂരിപ്പിക്കരുത്'''",
# Info page
'pageinfo-title' => '"$1" എന്ന താളിന്റെ വിവരങ്ങൾ',
'spam_reverting' => '$1शी दुवे नसलेल्या गेल्या आवर्तनाकडे परत उलटवत आहे',
'spam_blanking' => '$1शी दुवे असलेली सर्व आवर्तने,रिक्त केली जात आहेत',
'spam_deleting' => 'यातील सर्व आवृत्त्यांचे $1शी दुवे आहेत.गाळत आहे',
+'simpleantispam-label' => "चिखलणी विरोधक तपासणी.
+हे भरू '''नका'''!",
# Info page
'pageinfo-title' => '"$1" च्याबद्दल माहिती',
'spam_reverting' => 'Membalikkan kepada versi terakhir yang tidak mengandungi pautan ke $1',
'spam_blanking' => 'Mengosongkan semua semakan yang mengandungi pautan ke $1',
'spam_deleting' => 'Menghapuskan semua semakan yang mengandungi pautan ke $1',
+'simpleantispam-label' => "Pemeriksaan anti-spam. '''JANGAN''' isi ruangan ini!",
# Info page
'pageinfo-title' => 'Maklumat untuk "$1"',
'spam_reverting' => 'Tilbakestiller til siste versjon uten lenke til $1',
'spam_blanking' => 'Alle revisjoner inneholdt lenke til $1, tømmer siden',
'spam_deleting' => 'Sletter alle revisjoner med lenker til $1',
+'simpleantispam-label' => "Antispamsjekk.
+'''IKKE''' fyll inn dette feltet!",
# Info page
'pageinfo-title' => 'Informasjon om «$1»',
'spambot_username' => 'MediaWiki Spam-Oprümen',
'spam_reverting' => 'Trüchdreiht na de letzte Version ahn Lenken na $1.',
'spam_blanking' => 'All Versionen harrn Lenken na $1, rein maakt.',
+'simpleantispam-label' => "Antispam-Kuntrull. Hier '''nix''' indragen!",
# Info page
'pageinfo-title' => 'Informatschoon för "$1"',
'spam_reverting' => 'Teruggedraaid naar de laatste versie die geen koppeling bevat naar $1',
'spam_blanking' => 'Alle versies bevatten een koppeling naar $1. Pagina leeggemaakt',
'spam_deleting' => 'Alle versies bevatten koppelingen naar $1. Pagina verwijderd',
+'simpleantispam-label' => "Antispamcontrole.
+Vul dit veld '''NIET''' in!",
# Info page
'pageinfo-title' => 'Informatie over "$1"',
'spam_reverting' => 'Attenderullar til siste versjon utan lenkje til $1',
'spam_blanking' => 'Alle versjonar inneheldt lenkje til $1, tømmer sida',
'spam_deleting' => 'Alle versjonane inneheldt lenkjer til $1, slettar.',
+'simpleantispam-label' => "Antispam-kontroll.
+'''IKKJE''' fyll ut dette feltet!",
# Info page
'pageinfo-title' => 'Informasjon om «$1»',
'spam_reverting' => 'Restabliment de la darrièra version que conten pas de ligam cap a $1',
'spam_blanking' => 'Totas las versions que contenon de ligams cap a $1 son blanquidas',
'spam_deleting' => 'Totas las versions contenonián de ligams cap a $1, supression',
+'simpleantispam-label' => "Verificacion antispam.
+Inscrigatz '''PAS RES''' dedins !",
# Info page
'pageinfo-title' => 'Informacions per « $1 »',
'spam_reverting' => '$1 ସହ ଯୋଡ଼ା ନଥିବା ଶେଷ ସଂସ୍କରଣକୁ ଲେଉଟାଇ ଦେଉଅଛୁଁ',
'spam_blanking' => '$1 ସହ ଯୋଡ଼ାଥିବା ସବୁଯାକ ସଂସ୍କରଣ ଖାଲି କରିଦିଆଗଲା',
'spam_deleting' => '$1 ସହ ଯୋଡ଼ାଥିବା ସବୁଯାକ ସଂସ୍କରଣ ଖାଲି କରିଦିଆଗଲା',
+'simpleantispam-label' => "ସ୍ପାମ-ବିରୋଧି ପରଖ ।
+ଏହାକୁ ଭରନ୍ତୁ '''ନାହିଁ''' !",
# Info page
'pageinfo-title' => '"$1"ର ବିବରଣୀ',
ਸਧਾਰਨ ਝਲਕ ਦੀ ਕੋਸ਼ਿਸ਼ ਕਰੋ।',
# Watchlist editor
-'watchlistedit-noitems' => 'ਤੁਹਾਡੀ ਨਿਗਰਾਨੀ-ਲਿਸਟ ਵਿਚ ਕੋਈ ਸਿਰਲੇਖ ਨਹੀਂ ਹਨ।',
+'watchlistedit-numitems' => 'ਗੱਲ-ਬਾਤ ਸਫ਼ਿਆਂ ਤੋਂ ਬਿਨਾਂ, ਤੁਹਾਡੀ ਨਿਗਰਾਨੀ-ਲਿਸਟ ਵਿੱਚ {{PLURAL:$1|1 ਸਿਰਲੇਖ ਹੈ|$1 ਸਿਰਲੇਖ ਹਨ}}।',
+'watchlistedit-noitems' => 'ਤੁਹਾਡੀ ਨਿਗਰਾਨੀ-ਲਿਸਟ ਵਿੱਚ ਕੋਈ ਸਿਰਲੇਖ ਨਹੀਂ ਹਨ।',
'watchlistedit-normal-title' => 'ਨਿਗਰਾਨੀ-ਲਿਸਟ ਸੋਧੋ',
-'watchlistedit-normal-legend' => 'ਨਿà¨\97ਰਾਨà©\80-ਲਿਸà¨\9f ਤà©\8bà¨\82 ਸਿਰਲà©\87à¨\96 ਹਟਾਓ',
+'watchlistedit-normal-legend' => 'ਸਿਰਲà©\87à¨\96ਾà¨\82 ਨà©\82à©° ਨਿà¨\97ਰਾਨà©\80-ਲਿਸà¨\9f ਵਿੱà¨\9aà©\8bà¨\82 ਹਟਾਓ',
'watchlistedit-normal-submit' => 'ਸਿਰਲੇਖ ਹਟਾਓ',
+'watchlistedit-normal-done' => 'ਤੁਹਾਡੀ ਨਿਗਰਾਨੀ-ਲਿਸਟ ਵਿੱਚੋਂ {{PLURAL:$1|1 ਸਿਰਲੇਖ ਹਟਾਇਆ ਗਿਆ|$1 ਸਿਰਲੇਖ ਹਟਾਏ ਗਏ}}:',
'watchlistedit-raw-title' => 'ਕੱਚੀ ਨਿਗਰਾਨ-ਸੂਚੀ ਸੋਧੋ',
-'watchlistedit-raw-legend' => 'ਕੱਚੀ ਨਿਗਰਾਨ-ਸੂਚੀ ਸੋਧੋ',
+'watchlistedit-raw-legend' => 'ਕੱਚੀ ਨਿਗਰਾਨੀ-ਲਿਸਟ ਸੋਧੋ',
+'watchlistedit-raw-explain' => 'ਤੁਹਾਡੀ ਨਿਗਰਾਨੀ-ਲਿਸਟ ਵਿੱਚ ਮੌਜੂਦ ਸਫ਼ੇ ਹਟਾਏ ਜਾਂ ਹੋਰ ਜੋੜੇ ਜਾ ਸਕਦੇ ਹਨ। ਹਟਾਉਣ ਜਾਂ ਜੋੜਨ ਤੋਂ ਬਾਅਦ "{{int:Watchlistedit-raw-submit}}" ’ਤੇ ਕਲਿੱਕ ਕਰੋ।
+ਤੁਸੀਂ [[Special:EditWatchlist|ਮਿਆਰੀ ਐਡੀਟਰ]] ਵੀ ਵਰਤ ਸਕਦੇ ਹੋ।',
'watchlistedit-raw-titles' => 'ਸਿਰਲੇਖ:',
'watchlistedit-raw-submit' => 'ਨਿਗਰਾਨੀ-ਲਿਸਟ ਤਾਜ਼ੀ ਕਰੋ',
-'watchlistedit-raw-done' => 'ਤੁਹਾਡੀ ਨਿਗਰਾਨ-ਸੂਚੀ ਅੱਪਡੇਟ ਹੋ ਗਈ ਹੈ।',
-'watchlistedit-raw-added' => '{{PLURAL:$1|1 title was|$1 titles were}} ਸ਼ਾਮਲ:',
-'watchlistedit-raw-removed' => '{{PLURAL:$1|1 title was|$1 titles were}} ਹਟਾਓ:',
+'watchlistedit-raw-done' => 'ਤੁਹਾਡੀ ਨਿਗਰਾਨੀ-ਲਿਸਟ ਅੱਪਡੇਟ ਹੋ ਗਈ ਹੈ।',
+'watchlistedit-raw-added' => '{{PLURAL:$1|1 ਸਿਰਲੇਖ ਸ਼ਾਮਲ ਕੀਤਾ|$1 ਸਿਰਲੇਖ ਸ਼ਾਮਲ ਕੀਤੇ}}:',
+'watchlistedit-raw-removed' => '{{PLURAL:$1|1 ਸਿਰਲੇਖ ਹਟਾਇਆ|$1 ਸਿਰਲੇਖ ਹਟਾਏ}}:',
# Watchlist editing tools
'watchlisttools-view' => 'ਸਬੰਧਤ ਤਬਦੀਲੀਆਂ ਵੇਖੋ',
'userlogin-resetpassword-link' => 'Nie pamiętasz hasła?',
'helplogin-url' => 'Help:Logowanie',
'userlogin-helplink' => '[[{{MediaWiki:helplogin-url}}|Pomoc z logowaniem]]',
+'userlogin-loggedin' => 'Zalogowano jako {{GENDER:$1|$1}}.
+Użyj poniższego formularza, aby zalogować się jako inny użytkownik.',
+'userlogin-createanother' => 'Załóż nowe konto',
'createacct-join' => 'Wpisz poniżej swoje dane.',
'createacct-another-join' => 'Wprowadź szczegóły nowego konta poniżej.',
'createacct-emailrequired' => 'Adres e‐mail',
'spam_reverting' => 'Przywracanie ostatniej wersji nie zawierającej linków do $1',
'spam_blanking' => 'Wszystkie wersje zawierały odnośniki do $1. Czyszczenie strony.',
'spam_deleting' => 'Wszystkie wersje zawierały linki do $1, usuwam.',
+'simpleantispam-label' => "Filtr antyspamowy.
+'''NIE''' wpisuj tu nic!",
# Info page
'pageinfo-title' => 'Informacje o „$1“',
'spam_reverting' => "Butà andaré a l'ùltima version che a l'avèissa pa andrinta dj'anliure a $1",
'spam_blanking' => "Pàgina dësvujdà, che tute le version a l'avìo andrinta dj'anliure a $1",
'spam_deleting' => 'Scancelà, dagià che tute le revision a contnisìo dle liure a $1',
+'simpleantispam-label' => "Control anti-spam.
+Vemp '''PA''' sòn-sì!",
# Info page
'pageinfo-title' => 'Anformassion për «$1»',
'spambot_username' => 'میڈیاوکی سپام سفائی',
'spam_reverting' => 'آخری ریوین ول جیدے چ $1 دے جوڑ ناں ہون۔',
'spam_blanking' => 'سارے ریوین جناں چ $1 نوں جوڑ نیں، طاف کیتا جاریا اے۔',
+'simpleantispam-label' => 'سپام روک پھاٹک
+ایدے تے ناں لکھو۔',
# Info page
'pageinfo-title' => '"$1" لئی جانکاری',
'spam_reverting' => 'A reverter para a última revisão que não contém links para $1',
'spam_blanking' => 'Todas as revisões continham links para $1; a esvaziar',
'spam_deleting' => 'Todas as revisões continham links para $1; a eliminar',
+'simpleantispam-label' => "Verificação de spam
+'''NÃO''' preencha isto!",
# Info page
'pageinfo-title' => 'Informações sobre "$1"',
* @author Sir Lestaty de Lioncourt
* @author Teles
* @author TheGabrielZaum
+ * @author Titoncio
* @author Urhixidur
* @author Vivaelcelta
* @author Vuln
'spam_reverting' => 'Revertendo para a última versão que não contém links para $1',
'spam_blanking' => 'Todas revisões contendo links para $1, limpando',
'spam_deleting' => 'Eliminada por todas as suas edições conterem links para $1',
+'simpleantispam-label' => "Verificação de spam
+'''NÃO''' preencha isto!",
# Info page
'pageinfo-title' => 'Informações sobre "$1"',
Parameters:
* $1 - a spammed domain name',
+'simpleantispam-label' => 'Used as label for the input box in "Edit" page.
+
+The label and the input box are always hidden.',
# Info page
'pageinfo-title' => 'Page title for action=info. Parameters:
# General errors
'error' => 'Pantasqa',
'databaseerror' => 'Willañiqintin pantasqa',
+'databaseerror-text' => "Willañiqintin maskana pantasqam tukurqan. Llamp'u kaqpi pantasqachá kachkan.",
+'databaseerror-textcl' => 'Willañiqintin maskana pantasqam tukurqan.',
+'databaseerror-query' => 'Maskana: $1',
+'databaseerror-function' => 'Ruray paqtachi: $1',
+'databaseerror-error' => 'Pantasqa: $1',
'laggedslavemode' => "'''Paqtataq''': Kay p'anqapiqa manaraqchá kachkanchu aswan qayna musuqchasqakuna.",
'readonly' => "Willañiqintinqa hark'asqam",
'enterlockreason' => "Qillqamuy imarayku hark'asqa karqan, hayk'appas manañachá hark'asqachu kanqa",
'cannotdelete-title' => 'Manam atinichu "$1" sutiyuq p\'anqata qulluyta',
'delete-hook-aborted' => "Ch'iwinam qulluyta t'ipirqan.
Manam nirqanchu imarayku.",
+'no-null-revision' => 'Manam atinichu "$1" p\'anqapaq musuq ch\'usaq musuqchasqata kamariyta.',
'badtitle' => "P'anqap sutinqa manam allinchu",
'badtitletext' => "Kay p'anqap sutinqa manam allinchu, mana allin interwiki t'inkichá icha ch'usaqchá, p'anqa sutipaq mana saqillasqa sananchayuqchá.",
'perfcached' => "Kay qatiq willakunaqa ''cache'' nisqa pakasqa hallch'apim kachkan, chayrayku manañachá musuqchasqachu. {{PLURAL:$1|Huklla|$1-lla}} taripasqam pakasqa hallch'api aypalla kachkan, manam aswanchu.",
'customjsprotected' => "Manam saqillasunkichu kay JavaScript p'anqata llamk'apuyta, huk ruraqpa kikin tiyachisqankunayuq kaptinmi.",
'mycustomcssprotected' => "Kay CSS p'anqataqa manam llamk'apuyta atinkichu.",
'mycustomjsprotected' => "Kay JavaScript p'anqataqa manam llamk'apuyta atinkichu.",
+'myprivateinfoprotected' => "Manam saqillasqachu kanki kikiykip akuna willaykikunata llamk'apunaykipaq.",
+'mypreferencesprotected' => "Manam saqillasqachu kanki allinkachinaykikunata llamk'apunaykipaq.",
'ns-specialprotected' => "{{ns:special}} suti k'itipi p'anqakunaqa manam llamk'apunallachu.",
'titleprotected' => "Kay p'anqa sutitaqa [[User:$1|$1]] sutiyuq ruraq kamariymanta hark'arqanmi, kayraykum nispa: ''$2''.",
'filereadonlyerror' => 'Manam atinichu "$1" sutiyuq willañiqita hukchayta, "$2" sutiyuq willañiqi churamuna ñawirillanapaq kachkaptinmi.
'yourname' => 'Ruraq sutiyki:',
'userlogin-yourname' => 'Ruraqpa sutin',
'userlogin-yourname-ph' => 'Ruraqpa sutiykita yaykuchiy',
+'createacct-another-username-ph' => 'Ruraqpa sutinta yaykuchiy',
'yourpassword' => 'Yaykuna rimayki',
'userlogin-yourpassword' => 'Yaykuna rima',
'userlogin-yourpassword-ph' => 'Yaykuna rimaykita yaykuchiy',
'userlogin-resetpassword-link' => 'Yaykuna rimaykita kutichiy',
'helplogin-url' => 'Help:Yaykuy',
'userlogin-helplink' => '[[{{MediaWiki:helplogin-url}}|Yaykunapaq yanapa]]',
+'userlogin-createanother' => 'Huk rakiqunata kamariy',
'createacct-join' => 'Kay qatiqpi willaykita yaykuchiy.',
'createacct-emailrequired' => 'E-chaski imamayta',
'createacct-emailoptional' => 'E-chaski imamayta (munaspayki)',
'createacct-email-ph' => 'E-chaski imamaytaykita yaykuchiy',
+'createacct-another-email-ph' => 'E-chaski imamaytata yaykuchiy',
'createaccountmail' => "Kikinmanta tukusqa mit'alla yaykuna rimata llamk'achispa akllasqa e-chaski imamaytaman kachay",
'createacct-realname' => 'Chiqap suti (munaspayki)',
'createaccountreason' => 'Kayrayku:',
'createacct-captcha' => 'Amachana llanchiy',
'createacct-imgcaptcha-ph' => 'Hanaqpi rikusqayki qillqata yaykuchiy',
'createacct-submit' => 'Rakiqunaykita kamariy',
+'createacct-another-submit' => 'Huk rakiqunata kamariy',
'createacct-benefit-heading' => '{{SITENAME}}taqa qam hina runakunam ruran.',
'createacct-benefit-body1' => "{{PLURAL:$1|llamk'apusqa|llamk'apusqakuna}}",
'createacct-benefit-body2' => "{{PLURAL:$1|p'anqa|p'anqakuna}}",
'login-abort-generic' => 'Yaykuykachaspayki manam ayparqankichu - Allqasqa',
'loginlanguagelabel' => 'Rimay: $1',
'suspicious-userlogout' => "Lluqsiy mañakuyniykiqa mananchasqam karqan, waqllisqa wamp'unamanta icha pakaq proksimanta kachasqa kaspanchá.",
+'createacct-another-realname-tip' => "* Chiqap sutiqa munanallapaqmi. Quwaptiykiqa, llamk'apusqakunam paywan sananchasqa kanqa.",
# Email sending
'php-mail-error-unknown' => 'Mana riqsisqa pantasqa PHP mail() rurananpi',
'changeemail-submit' => 'E-chaskita wakinchay',
'changeemail-cancel' => 'Ama niy',
+# Special:ResetTokens
+'resettokens' => 'Llawikunata kutichiy',
+'resettokens-no-tokens' => 'Manam kanchu kutichina llawikuna.',
+'resettokens-legend' => 'Llawikunata kutichiy',
+'resettokens-tokens' => 'Llawikuna:',
+'resettokens-token-label' => '$1 (kunan chani: $2)',
+'resettokens-done' => 'Llawikunaqa kutichimusqañam.',
+'resettokens-resetbutton' => 'Akllasqa llawikunata kutichimuy',
+
# Edit page toolbar
'bold_sample' => 'Yanasapa qillqa',
'bold_tip' => 'Yanasapa qillqa',
'undo-failure' => "Manam atinichu llamk'apusqata kutichiyta, huk ruraqtaq musuqta llamk'apurquptinñam.",
'undo-norev' => "Manam atinichu llamk'apusqata kutichiyta, mana kaptinmi icha qullusqa kaptinmi.",
'undo-summary' => '[[Special:Contributions/$2|$2]]-pa $1 hukchasqanta kutichisqa ([[User talk:$2|rimay]])',
+'undo-summary-username-hidden' => 'Pakasqa ruraqpa $1 nisqa musuqchasqata kutichiy',
# Account creation failure
'cantcreateaccounttitle' => 'Manam atinichu rakiqunata kichayta',
'compareselectedversions' => "Akllasqa llamk'apusqakunata wakichay",
'showhideselectedversions' => 'Akllasqa musuqchasqakunata rikuchiy/pakay',
'editundo' => 'kutichiy',
+'diff-empty' => '(Manam wak hina kanchu)',
'diff-multi' => "({{PLURAL:$2|Huk ruraqpa|$2 ruraqpa}} {{PLURAL:$1|chawpipi huk llamk'apusqanqa manam rikuchisqachu|chawpipi $1 llamk'apusqankunaqa manam rikuchisqachu}})",
'diff-multi-manyusers' => "({{PLURAL:$2|Hukmanta|$2-manta}} aswan ruraqkunap {{PLURAL:$1|chawpipi huk llamk'apusqanqa manam rikuchisqachu|chawpipi $1 llamk'apusqankunaqa manam rikuchisqachu}})",
'difference-missing-revision' => "Kay wakin kaymanta ($1) {{PLURAL:$2|huk musuqchasqa|$2 musuqchasqakuna}} manam tarisqachu.
'prefs-dateformat' => "P'unchaw rikch'ay",
'prefs-timeoffset' => 'Pacha wakinyay',
'prefs-advancedediting' => 'Sapsi akllanakuna',
+'prefs-editor' => "P'anqachaq",
+'prefs-preview' => 'Ñawpaqta qhawallay',
'prefs-advancedrc' => 'Ñawparikusqa akllanakuna',
'prefs-advancedrendering' => 'Ñawparikusqa akllanakuna',
'prefs-advancedsearchoptions' => 'Ñawparikusqa akllanakuna',
'prefs-displayrc' => 'Akllanakunata rikuchiy',
'prefs-displaysearchoptions' => 'Akllanakunata rikuchiy',
'prefs-displaywatchlist' => 'Akllanakunata rikuchiy',
+'prefs-tokenwatchlist' => 'Llawi',
'prefs-diffs' => 'Wakin kaykuna',
# User preference: email validation using jQuery
'right-unblockself' => "Kikinta hark'asqamanta qispikuy",
'right-protect' => "Amachasqa kachkayta hukchay, ch'aqtasqa amachasqa p'anqakunata llamk'apuy",
'right-editprotected' => 'Amachasqa p\'anqakunata "{{int:protect-level-sysop}}" hina llamk\'apuy',
+'right-editsemiprotected' => '"{{int:protect-level-autoconfirmed}}" hina amachasqa p\'anqakunata llamk\'apuy',
'right-editinterface' => "Ruraqpaq uyapurata llamk'apuy",
'right-editusercssjs' => "Huk ruraqkunap CSS, JS willañiqinkunata llamk'apuy",
'right-editusercss' => "Huk ruraqkunap CSS willañiqinkunata llamk'apuy",
'right-edituserjs' => "Huk ruraqkunap JS willañiqinkunata llamk'apuy",
'right-editmyusercss' => "Kikiykip ruraqpaq CSS willañiqiykikunata llamk'apuy",
'right-editmyuserjs' => "Kikiykip ruraqpaq JavaScript willañiqiykikunata llamk'apuy",
+'right-viewmywatchlist' => 'Kikiykip watiqasqayki sutisuyuykita qhaway',
+'right-editmywatchlist' => "Kikiykip watiqasqayki sutisuyuykita llamk'apuy. Paqtataq, huk ruranakunaqa p'anqakunata yapanqaraqmi kay hañi mana kaptinpas.",
+'right-viewmyprivateinfo' => 'Kikiykip akuna willaykikunata qhaway (ahinataq e-chaski imamaytayki, chiqap sutiyki)',
+'right-editmyprivateinfo' => "Kikiykip akuna willaykikunata llamk'apuy (ahinataq e-chaski imamaytayki, chiqap sutiyki)",
+'right-editmyoptions' => "Kikiykip allinkachinaykikunata llamk'apuy",
'right-rollback' => "Huk p'anqapi qhipaq llamk'apuqpa hukchasqankunata utqaylla kutichiy",
'right-markbotedits' => "Kutichisqa llamk'apusqakunata rurana antachap llamk'apusqankunata hina sananchay",
'right-noratelimit' => 'Achura saywakunap manam chayachisqanchu',
'action-userrights-interwiki' => "hawa wikikunapi ruraqkunap hayñinkunata llamk'apuy",
'action-siteadmin' => "willañiqintinta hark'ay icha paskay",
'action-sendemail' => 'e-chaskikunata kachay',
+'action-editmywatchlist' => "watiqasqayki sutisuyuta llamk'apuy",
+'action-viewmywatchlist' => 'watiqasqayki sutisuyuta qhaway',
+'action-viewmyprivateinfo' => 'kikiykip akuna willaykikunata qhaway',
+'action-editmyprivateinfo' => "kikiykip akuna willaykikunata llamk'apuy",
# Recent changes
'nchanges' => '$1 {{PLURAL:$1|hukchasqa|hukchasqakuna}}',
+'enhancedrc-since-last-visit' => '$1 {{PLURAL:$1|qhipaq watukusqamantapacha}}',
+'enhancedrc-history' => 'wiñay kawsay',
'recentchanges' => 'Ñaqha hukchasqa',
'recentchanges-legend' => 'Ñaqha hukchasqapaq allinkachinakuna',
'recentchanges-summary' => "Kay p'anqapiqa aswan qhipaq ñaqha hukchasqakunam.",
+'recentchanges-noresult' => "Kay taripanakama hukchasqakunaqa akllasqa mit'api manam kanchu.",
'recentchanges-feed-description' => 'Kay mikhuchinapi wikipi qhipaq ñaqha hukchasqakunata qatiy.',
'recentchanges-label-newpage' => "Kayta llamk'apuptiykim musuq p'anqam tukukurqun",
'recentchanges-label-minor' => "Kayqa aslla llamk'apuymi",
'listfiles_size' => 'Hatun kay',
'listfiles_description' => "T'iktuna",
'listfiles_count' => 'Musuqchasqakuna',
+'listfiles-show-all' => "Rikchakunamanta mawk'a musuqchasqakunata ch'aqtay",
+'listfiles-latestversion' => 'Kunan musuqchasqa',
+'listfiles-latestversion-yes' => 'Arí',
+'listfiles-latestversion-no' => 'Mana',
# File description page
'file-anchor-link' => 'Rikcha',
'randompage' => "Mayninpi p'anqa",
'randompage-nopages' => "Manam ima p'anqapas kanchu kay suti {{PLURAL:$2|k'itipi|k'itikunapi}}: $1.",
+# Random page in category
+'randomincategory' => "Katiguriyapi kikinmanta p'anqa",
+'randomincategory-invalidcategory' => '"$1" nisqaqa katiguriyapaq manam allin sutinchu.',
+'randomincategory-nopages' => "[[:Category:$1|$1]] katiguriyapiqa manam p'anqakuna kanchu.",
+'randomincategory-selectcategory' => "Katiguriyamanta kikinmanta p'anqata chaskiy: $1 $2.",
+'randomincategory-selectcategory-submit' => 'Riy',
+
# Random redirect
'randomredirect' => "Mayninpi pusapuna p'anqa",
'randomredirect-nopages' => 'Manam kanchu "$1" nisqa suti k\'itipi pusapuna p\'anqakuna.',
'tags-tag' => 'Unanchachap sutin',
'tags-display-header' => "Hukchasqakunamanta sutisuyup rikch'akuynin",
'tags-description-header' => "Sut'inmanta hunt'a ch'uyanchaynin",
+'tags-active-header' => 'Ruraqllachu?',
'tags-hitcount-header' => 'Unanchasqa hukchasqakuna',
+'tags-active-yes' => 'Arí',
+'tags-active-no' => 'Mana',
'tags-edit' => "llamk'apuy",
'tags-hitcount' => '$1 {{PLURAL:$1|hukchasqa|hukchasqakuna}}',
# Image rotation
'rotate-comment' => "Rikch'aqa pacha rikuchiqwan $1 {{PLURAL:$1|k'atma}} muyusqam",
+# Limit report
+'limitreport-cputime-value' => '$1 {{PLURAL:$1|sikundu|sikundukuna}}',
+'limitreport-walltime-value' => '$1 {{PLURAL:$1|sikundu|sikundukuna}}',
+'limitreport-postexpandincludesize-value' => '$1/$2 {{PLURAL:$2|byte}}',
+'limitreport-templateargumentsize-value' => '$1/$2 {{PLURAL:$2|byte}}',
+
);
'spam_reverting' => 'Revenire la ultima versiune care nu conține legături către $1',
'spam_blanking' => 'Toate versiunile conținând legături către $1 au fost golite',
'spam_deleting' => 'Toate versiunile conținând legături către $1 au fost șterse',
+'simpleantispam-label' => "Verificare antispam.
+'''NU''' completați !",
# Info page
'pageinfo-title' => 'Informații pentru „$1”',
'spam_reverting' => "Turnanne a l'urtema revisione no ge condiene collegaminde a $1",
'spam_blanking' => 'Tutte le revisiune condènene collegaminde a $1, vacande',
'spam_deleting' => 'Tutte le revisiune condènene collegaminde a $1, stoche a scangelle',
+'simpleantispam-label' => "Verifiche andi-spam.
+'''NO''' anghiè quiste!",
# Info page
'pageinfo-title' => '\'Mbormaziune pe "$1"',
'spam_reverting' => 'Откат к последней версии, не содержащей ссылки на $1',
'spam_blanking' => 'Все версии содержат ссылки на $1, очистка',
'spam_deleting' => 'Все версии содержали ссылки на $1, производится удаление',
+'simpleantispam-label' => 'Анти-спам проверка.
+НЕ заполняйте это!',
# Info page
'pageinfo-title' => 'Сведения по «$1»',
'spam_reverting' => 'Реверт на послїдню верзію необсягуючу одказы на $1',
'spam_blanking' => 'Вшыткы ревізії обсяговали одказы на $1, выпорожнєны',
'spam_deleting' => 'Вшыткы ревізії обсяговали одказы на $1, змазане',
+'simpleantispam-label' => "Перевірка на спам.
+'''НЕ''' заповнюйте тото!",
# Info page
'pageinfo-title' => 'Інформація про "$1"',
'spam_reverting' => '$1 इत्यनेन नानुबद्धनां प्राचीनपुनरावृत्तीनां पुनस्थापनं कुर्वन्ति ।',
'spam_blanking' => 'सर्वाः पुनरावृत्तयः $1 इत्यस्य अनुबन्धाः पूर्णपाठाः अपनीयन्ते ।',
'spam_deleting' => 'सर्वाः पुनरावृत्तयः $1 इत्यस्य अनुबन्धाः । पूर्णपाठाः अपनीयन्ते ।',
+'simpleantispam-label' => "अनिष्टसन्देशविरोधपरीक्षणम् ।
+अस्मिन् '''नहि''' पूर्यताम् !",
# Info page
'pageinfo-title' => '"$1" कृते सूचनाः ।',
'spam_reverting' => 'Манна: $1 ыйынньыга суох бүтэһик торуму сөргүтүү (төннөрүү)',
'spam_blanking' => 'Бары торумнар манна "$1" ыйынньыктаахтар, барытын суох оҥоруу',
'spam_deleting' => 'Бары барыллар манна "$1" сигэнэллэр эит, сотуу бара турар',
+'simpleantispam-label' => "Анти-спам бэрэбиэркэтэ.
+Маны '''толорумаҥ'''!",
# Info page
'pageinfo-title' => '"$1" туһунан',
'spambot_username' => 'මීඩියාවිකි ස්පෑම් ඉවත්කිරීම',
'spam_reverting' => ' $1 හට සබැඳියන් නොමැති අවසන් අනුවාදය වෙත ප්රතිවර්තනය වෙමින්',
'spam_blanking' => 'සියළු සංශෝධනයන්හි $1 වෙතවූ සබැඳියන් අඩංගු විය, හිස්කරමින්',
+'simpleantispam-label' => "ප්රති-ස්පෑම පරීක්ෂාව.
+කරුණාකර මෙය පුරවන්න '''එපා'''!",
# Info page
'pageinfo-title' => '"$1" සඳහා තොරතුරු',
'spam_reverting' => 'Vraciam poslednú verziu, ktorá neobsahuje odkazy na $1',
'spam_blanking' => 'Všetky revízie obsahovali odkaz na $1, odstraňujem obsah',
'spam_deleting' => 'Všetky revízie obsahovali odkaz na $1, odstraňuje sa',
+'simpleantispam-label' => "Antispamová kontrola.
+'''NEVYPĹŇAJTE''' nasledovné!",
# Info page
'pageinfo-title' => 'Informácie o „$1“',
'spam_reverting' => 'Vračanje na zadnjo redakcijo brez povezav na $1',
'spam_blanking' => 'Vse redakcije so vsebovale povezave na $1, izpraznjujem',
'spam_deleting' => 'Vse redakcije so vsebovale povezave na $1, brišem',
+'simpleantispam-label' => "Preverjanje proti smetju.
+'''NE''' izpolnite tega!",
# Info page
'pageinfo-title' => 'Informacije o »$1«',
'spam_reverting' => "U kthye tek versioni i fundit që s'ka lidhje tek $1",
'spam_blanking' => 'U boshatis sepse të gjitha versionet kanë lidhje tek $1',
'spam_deleting' => 'Të gjitha inspektimet përmbanin lidhje në $1, duke fshirë',
+'simpleantispam-label' => "Kontroll anti-spam.
+'''MOS''' e plotësoni këtë!",
# Info page
'pageinfo-title' => 'Informacion për " $1 "',
'spam_reverting' => 'Враћам на последњу измену која не садржи везе до $1',
'spam_blanking' => 'Све измене садрже везе до $1. Чистим',
'spam_deleting' => 'Све измене садрже везе до $1. Бришем',
+'simpleantispam-label' => "Провера спама. '''НЕ''' попуњавај ово унутра!",
# Info page
'pageinfo-title' => 'Подаци о „$1“',
'spam_reverting' => 'Vraćam na poslednju izmenu koja ne sadrži veze do $1',
'spam_blanking' => 'Sve izmene sadrže veze do $1. Čistim',
'spam_deleting' => 'Sve izmene sadrže veze do $1. Brišem',
+'simpleantispam-label' => "Provera spama. '''NE''' popunjavaj ovo unutra!",
# Info page
'pageinfo-title' => 'Podaci o „$1“',
'spambot_username' => 'MediaWiki Spam-Süüwerenge',
'spam_reverting' => 'Lääste Version sunner Links tou $1 wier häärstoald.',
'spam_blanking' => 'Aal Versione äntheelden Links tou $1, skeenmoaked.',
+'simpleantispam-label' => "Spamskuts-Wröige. Hier '''niks''' iendreege!",
# Info page
'pageinfo-title' => 'Informatione tou „$1“',
'spam_reverting' => 'Återställer till den senaste versionen som inte innehåller länkar till $1',
'spam_blanking' => 'Alla versioner innehöll en länk till $1, blankar',
'spam_deleting' => 'Alla ändringar innehöll länkar till $1, raderar',
+'simpleantispam-label' => "Anti-spam koll.
+Fyll '''INTE''' i det här!",
# Info page
'pageinfo-title' => 'Information om "$1"',
'spambot_username' => 'MediaWiki spam arassalaýyş',
'spam_reverting' => '$1 sahypasyna çykgytlary bolmadyk iň soňky wersiýasyna yzyna getirilýär',
'spam_blanking' => 'Ähli wersiýalarda $1 sahypasyna çykgytlar bar, boşadylýar',
+'simpleantispam-label' => "Anti-spam barlagy.
+Muny '''DOLDURMAŇ'''!",
# Patrolling
'markaspatrolleddiff' => 'Patrullyk edilen diýip belle',
'spam_reverting' => "Ibinabalik sa huling bersyon na 'di-naglalaman ng mga kawing sa $1",
'spam_blanking' => 'Lahat ng mga pagbabago ay naglalaman ng mga kawing sa $1, pagpapatlang',
'spam_deleting' => 'Lahat ng mga pagbabago ay naglalaman ng mga kawing sa $1, binubura',
+'simpleantispam-label' => "Pagsusuring panlaban sa \"manlulusob\" (''spam'').
+'''HUWAG''' itong lagyan ng laman!",
# Info page
'pageinfo-title' => 'Kabatiran para sa "$1"',
'morelinkstoimage' => 'Bu dosyaya [[Special:WhatLinksHere/$1|daha fazla bağlantıları]] gör.',
'linkstoimage-redirect' => '$1 (dosya yönlendirme) $2',
'duplicatesoffile' => 'Şu {{PLURAL:$1|dosya|$1 dosya}}, bu dosyanın kopyası ([[Special:FileDuplicateSearch/$2|daha fazla ayrıntı]]):',
-'sharedupload' => 'Bu dosya $1 deposundan ve diğer projelerde kullanılıyor olabilir.',
+'sharedupload' => 'Bu dosya $1 projesinden olup, diğer projelerde kullanılıyor olabilir.',
'sharedupload-desc-there' => 'Bu dosya $1 deposundan ve diğer projeler tarafından kullanılıyor olabilir. Daha fazla bilgi için lütfen [$2 dosya açıklama sayfasına] bakın.',
'sharedupload-desc-here' => 'Bu dosya $1 deposundan ve diğer projeler tarafından kullanılıyor olabilir.
Aşağıda [$2 dosya açıklama sayfasındaki] açıklama gösteriliyor.',
-'sharedupload-desc-create' => 'Bu dosya, $1 ve diğer projeler tarafından kullanılıyor olabilir.
-Dosya açıklamasını düzenlemek isterseniz, [$2 dosya açıklama sayfası] bulunmaktadır.',
+'sharedupload-desc-edit' => 'Bu dosya $1 projesinden olup, diğer projelerde kullanılıyor olabilir.
+Dosyanın açıklama sayfasında değişiklik yapmak için ilgili sayfaya [$2 buradan] gidebilirsiniz.',
+'sharedupload-desc-create' => 'Bu dosya $1 projesinden olup, diğer projelerde kullanılıyor olabilir.
+Dosyanın açıklama sayfasında değişiklik yapmak için ilgili sayfaya [$2 buradan] gidebilirsiniz.',
'filepage-nofile' => 'Bu isimde bir dosya yok.',
'filepage-nofile-link' => 'Bu isimde bir dosya yok, ama siz [$1 yükleyebilirsiniz].',
'uploadnewversion-linktext' => 'Dosyanın yenisini yükleyin',
'spambot_username' => 'Medyaviki spam temizleme',
'spam_reverting' => '$1 ile bağlantı içermeyen son sürüme geri dönülüyor',
'spam_blanking' => 'Tüm revizyonlar $1 sayfasına bağlantı içeriyor, boşaltılıyor',
+'simpleantispam-label' => "Anti-spam denetimi.
+Bunu '''doldurmayın'''!",
# Info page
'pageinfo-title' => 'Bilgi için "$1"',
'index-category' => 'Индексировать кароно бамъёс',
'noindex-category' => 'Индексировать каронтэм бамъёс',
-'linkprefix' => '/^(.*?)(„|«)$/sDu',
+'linkprefix' => '/^((?>.*(?<!(?:„|«)$)))(.+)$/sDu',
'about' => 'Та сярысь',
'article' => 'Статья',
'spam_reverting' => 'Відкинути до останньої версії, що не містить посилання на $1',
'spam_blanking' => 'Всі версії містять посилання на $1, очистка',
'spam_deleting' => 'Все версії, що містили посилання на $1, вилучаються',
+'simpleantispam-label' => "Перевірка на спам.
+'''НЕ''' заповнюйте це!",
# Info page
'pageinfo-title' => 'Інформація про " $1 "',
'spam_reverting' => "Ripristinà l'ultima version priva de colegamenti a $1",
'spam_blanking' => 'Pàxena svodà, tute łe version le contegneva cołegamenti a $1',
'spam_deleting' => 'Pàjina scansełà, tute łe version łe contegneva ligamenti a $1',
+'simpleantispam-label' => "Controlo anti spam.
+'''NO STA''' scrivar gnente qua de soto!",
# Info page
'pageinfo-title' => 'Informasion par "$1"',
'spam_reverting' => 'Lùi lại đến phiên bản cuối không chứa liên kết đến $1',
'spam_blanking' => 'Tất cả các phiên bản có liên kết đến $1; tẩy trống',
'spam_deleting' => 'Tất cả các phiên bản có liên kết đến $1; xóa',
+'simpleantispam-label' => "Kiểm tra chống spam.
+Xin '''ĐỪNG''' điền gì vào!",
# Info page
'pageinfo-title' => 'Thông tin về “$1”',
'spambot_username' => 'MediaWiki垃圾清除',
'spam_reverting' => '恢復返去最後一個唔包含指去$1嘅連結嘅嗰個修訂。',
'spam_blanking' => '全部版本都含有指去$1嘅連結,留空',
+'simpleantispam-label' => "反垃圾檢查。
+'''唔好'''加入呢個!",
# Skin names
'skinname-cologneblue' => '科隆藍',
'articlepage' => '查看内容页面',
'talk' => '讨论',
'views' => '查看',
-'toolbox' => '工具箱',
+'toolbox' => '工具',
'userpage' => '查看用户页面',
'projectpage' => '查看项目页面',
'imagepage' => '查看文件页面',
'spam_reverting' => '恢复到不包含链接的最近修订版本$1',
'spam_blanking' => '消隐所有包含链接至$1的修订',
'spam_deleting' => '正在删除所有包含至$1的版本',
+'simpleantispam-label' => "反垃圾检查。
+'''不要'''加入这个!",
# Info page
'pageinfo-title' => '“$1”的信息',
'spam_reverting' => '恢復到不包含連結至$1的最近修訂版本',
'spam_blanking' => '所有包含連結至$1的修訂,清空',
'spam_deleting' => '所有包含連結至$1的修訂,刪除中',
+'simpleantispam-label' => "反垃圾檢查。
+'''不要'''加入這個!",
# Info page
'pageinfo-title' => '「$1」的信息',
'spam_reverting',
'spam_blanking',
'spam_deleting',
+ 'simpleantispam-label',
),
'info' => array(
'pageinfo-header',
),
'mediawiki.inspect' => array(
'scripts' => 'resources/mediawiki/mediawiki.inspect.js',
- 'dependencies' => 'jquery.byteLength',
+ 'dependencies' => array(
+ 'jquery.byteLength',
+ 'jquery.json',
+ ),
'targets' => array( 'desktop', 'mobile' ),
),
'mediawiki.feedback' => array(
*/
auditSelectors: function ( css ) {
var selectors = { total: 0, matched: 0 },
- style = document.createElement( 'style' );
+ style = document.createElement( 'style' ),
+ sheet, rules;
style.textContent = css;
document.body.appendChild( style );
- $.each( style.sheet.cssRules, function ( index, rule ) {
+ // Standards-compliant browsers use .sheet.cssRules, IE8 uses .styleSheet.rules…
+ sheet = style.sheet || style.styleSheet;
+ rules = sheet.cssRules || sheet.rules;
+ $.each( rules, function ( index, rule ) {
selectors.total++;
if ( document.querySelector( rule.selectorText ) !== null ) {
selectors.matched++;
try {
// Bartosz made me put this here.
if ( window.opera ) { throw window.opera; }
- console.table( data );
+ // Use Function.prototype#call to force an exception on Firefox,
+ // which doesn't define console#table but doesn't complain if you
+ // try to invoke it.
+ console.table.call( console.table, data );
return;
} catch (e) {}
try {
- console.log( JSON.stringify( data, null, 2 ) );
+ console.log( $.toJSON( data, null, 2 ) );
return;
} catch (e) {}
mw.log( data );
# tests/phpunit/includes/api
'ApiFormatTestBase' => "$testDir/phpunit/includes/api/format/ApiFormatTestBase.php",
'ApiTestCase' => "$testDir/phpunit/includes/api/ApiTestCase.php",
- 'ApiTestContext' => "$testDir/phpunit/includes/api/ApiTestCase.php",
- 'MockApi' => "$testDir/phpunit/includes/api/ApiTestCase.php",
+ 'ApiTestContext' => "$testDir/phpunit/includes/api/ApiTestContext.php",
+ 'MockApi' => "$testDir/phpunit/includes/api/MockApi.php",
+ 'UserWrapper' => "$testDir/phpunit/includes/api/UserWrapper.php",
'RandomImageGenerator' => "$testDir/phpunit/includes/api/RandomImageGenerator.php",
- 'UserWrapper' => "$testDir/phpunit/includes/api/ApiTestCase.php",
# tests/phpunit/includes/content
'DummyContentHandlerForTesting' => "$testDir/phpunit/includes/content/ContentHandlerTest.php",
# tests/phpunit/includes/libs
'GenericArrayObjectTest' => "$testDir/phpunit/includes/libs/GenericArrayObjectTest.php",
+ # tests/phpunit/media
+ 'FakeDimensionFile' => "$testDir/phpunit/includes/media/FakeDimensionFile.php",
+
# tests/phpunit/includes/site
'SiteTest' => "$testDir/phpunit/includes/site/SiteTest.php",
'TestSites' => "$testDir/phpunit/includes/site/TestSites.php",
/**
* Get a Parser object
+ *
+ * @param string $preprocessor
+ * @return Parser
*/
function getParser( $preprocessor = null ) {
global $wgParserConf;
$out = $parser->getPreloadText( $input, $title, $options );
} else {
$output = $parser->parse( $input, $title, $options, true, true, 1337 );
+ $output->setTOCEnabled( !isset( $opts['notoc'] ) );
$out = $output->getText();
if ( isset( $opts['showtitle'] ) ) {
/**
* 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 $opts array: Options array to look in
* @param $default Mixed: default value returned if not found
*/
private static function getOptionValue( $key, $opts, $default ) {
# showtitle make the first line the title
# comment run through Linker::formatComment() instead of main parser
# local format section links in edit comment text as local links
+# notoc disable table of contents
#
# You can also set the following parser properties via test options:
# wgEnableUploads, wgAllowExternalImages, wgMaxTocLevel,
</li>
</ul>
</div>
+
<h2><span class="mw-headline" id="Headline_1">Headline 1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: Headline 1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<h3><span class="mw-headline" id="Subheadline_1">Subheadline 1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: Subheadline 1">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
<h5><span class="mw-headline" id="Skipping_a_level">Skipping a level</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=3" title="Edit section: Skipping a level">edit</a><span class="mw-editsection-bracket">]</span></span></h5>
</li>
</ul>
</div>
+
<h1><span class="mw-headline" id="Level_1_Heading">Level 1 Heading</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: Level 1 Heading">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
<h2><span class="mw-headline" id="Level_2_Heading">Level 2 Heading</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: Level 2 Heading">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<h3><span class="mw-headline" id="Level_3_Heading">Level 3 Heading</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=3" title="Edit section: Level 3 Heading">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
</li>
</ul>
</div>
+
<h2><span class="mw-headline" id="title_1">title 1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: title 1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<h3><span class="mw-headline" id="title_1.1">title 1.1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: title 1.1">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
<h4><span class="mw-headline" id="title_1.1.1">title 1.1.1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=3" title="Edit section: title 1.1.1">edit</a><span class="mw-editsection-bracket">]</span></span></h4>
</li>
</ul>
</div>
+
<h2><span class="mw-headline" id="title_1">title 1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: title 1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<h3><span class="mw-headline" id="title_1.1">title 1.1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: title 1.1">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
<h4><span class="mw-headline" id="title_1.1.1">title 1.1.1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=3" title="Edit section: title 1.1.1">edit</a><span class="mw-editsection-bracket">]</span></span></h4>
<li class="toclevel-1 tocsection-5"><a href="#Section_2"><span class="tocnumber">2</span> <span class="toctext">Section 2</span></a></li>
</ul>
</div>
+
<h2><span class="mw-headline" id="Section_1">Section 1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: Section 1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<h3><span class="mw-headline" id="Section_1.1">Section 1.1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: Section 1.1">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
<h4><span class="mw-headline" id="Section_1.1.1">Section 1.1.1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=3" title="Edit section: Section 1.1.1">edit</a><span class="mw-editsection-bracket">]</span></span></h4>
<li class="toclevel-1 tocsection-3"><a href="#title_2"><span class="tocnumber">2</span> <span class="toctext">title 2</span></a></li>
</ul>
</div>
+
<h2><span class="mw-headline" id="title_1">title 1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: title 1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<h3><span class="mw-headline" id="title_1.1">title 1.1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: title 1.1">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
<h2><span class="mw-headline" id="title_2">title 2</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=3" title="Edit section: title 2">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<li class="toclevel-1 tocsection-5"><a href="#text_.22_text"><span class="tocnumber">5</span> <span class="toctext">text " text</span></a></li>
</ul>
</div>
+
<h2><span class="mw-headline" id="text_.3E_text">text > text</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: text > text">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<p>section 1
</p>
<li class="toclevel-1 tocsection-4"><a href="#.3Ditalic_heading"><span class="tocnumber">4</span> <span class="toctext">=<i>italic</i> heading</span></a></li>
</ul>
</div>
+
<h1><span class="mw-headline" id="foo.3D">foo=</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: foo=">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
<h1><span class="mw-headline" id=".3Dfoo">=foo</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: =foo">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
<h1><span class="mw-headline" id="italic_heading.3D"><i>italic</i> heading=</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=3" title="Edit section: italic heading=">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
</li>
</ul>
</div>
+
<h1><span class="mw-headline" id="Header_1">Header 1</span></h1>
<h2><span class="mw-headline" id="Header_1.1">Header 1.1</span></h2>
<h2><span class="mw-headline" id="Header_1.2">Header 1.2</span></h2>
</ul>
</div>
+
!! end
!! test
</li>
</ul>
</div>
+
<h2><span class="mw-headline" id="2">2</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: 2">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<h6><span class="mw-headline" id="6">6</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: 6">edit</a><span class="mw-editsection-bracket">]</span></span></h6>
<h3><span class="mw-headline" id="3">3</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=3" title="Edit section: 3">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
<li class="toclevel-1 tocsection-1"><a href="#Lost_episodes"><span class="tocnumber">1</span> <span class="toctext"><i>Lost</i> episodes</span></a></li>
</ul>
</div>
+
<h2><span class="mw-headline" id="Lost_episodes"><i>Lost</i> episodes</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Main_Page&action=edit&section=1" title="Edit section: Lost episodes">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
!! end
<li class="toclevel-1 tocsection-1"><a href="#should_be_bold_then_normal_text"><span class="tocnumber">1</span> <span class="toctext"><b>should be bold</b> then normal text</span></a></li>
</ul>
</div>
+
<h2><span class="mw-headline" id="should_be_bold_then_normal_text"><b>should be bold</b> then normal text</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Main_Page&action=edit&section=1" title="Edit section: should be bold then normal text">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
!! end
<li class="toclevel-1 tocsection-1"><a href="#Image"><span class="tocnumber">1</span> <span class="toctext">Image</span></a></li>
</ul>
</div>
+
<h2><span class="mw-headline" id="Image">Image <a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Main_Page&action=edit&section=1" title="Edit section: Image">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
!! end
<li class="toclevel-1 tocsection-1"><a href="#Quote"><span class="tocnumber">1</span> <span class="toctext">Quote</span></a></li>
</ul>
</div>
+
<h2><span class="mw-headline" id="Quote"><blockquote>Quote</blockquote></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Main_Page&action=edit&section=1" title="Edit section: Quote">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
!! end
<li class="toclevel-1 tocsection-1"><a href="#Proof:_2_.3C_3"><span class="tocnumber">1</span> <span class="toctext">Proof: 2 < 3</span></a></li>
</ul>
</div>
+
<h2><span class="mw-headline" id="Proof:_2_.3C_3">Proof: 2 < 3</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Main_Page&action=edit&section=1" title="Edit section: Proof: 2 < 3">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<p><small>Hanc marginis exiguitas non caperet.</small>
QED
<li class="toclevel-1 tocsection-2"><a href="#Foo_Bar_2"><span class="tocnumber">2</span> <span class="toctext"><i>Foo</i> Bar</span></a></li>
</ul>
</div>
+
<h2><span class="mw-headline" id="Foo_Bar"><i>Foo</i> <b>Bar</b></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: Foo Bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<h2><span class="mw-headline" id="Foo_Bar_2"><i>Foo</i> <blockquote>Bar</blockquote></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: Foo Bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<li class="toclevel-1 tocsection-2"><a href="#b.22.3EEvilbye"><span class="tocnumber">2</span> <span class="toctext"><sup> b">Evilbye</sup></span></a></li>
</ul>
</div>
+
<h2><span class="mw-headline" id="Hello"><sup class="in-h2">Hello</sup></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: Hello">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<h2><span class="mw-headline" id="b.22.3EEvilbye"><sup> b">Evilbye</sup></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: b">Evilbye">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<li class="toclevel-1 tocsection-5"><a href="#Attributes_after_dir_on_these_span_tags_must_be_deleted_from_the_TOC"><span class="tocnumber">5</span> <span class="toctext"><span dir="ltr">Attributes after dir on these span tags must be deleted from the TOC</span></span></a></li>
</ul>
</div>
+
<h2><span class="mw-headline" id="C.2B.2B"><span dir="ltr">C++</span></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: C++">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<h2><span class="mw-headline" id=".D7.96.D7.91.D7.A0.D7.92.21"><span dir="rtl">זבנג!</span></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: זבנג!">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<h2><span class="mw-headline" id="The_attributes_on_these_span_tags_must_be_deleted_from_the_TOC"><span style="font-style: italic">The attributes on these span tags must be deleted from the TOC</span></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=3" title="Edit section: The attributes on these span tags must be deleted from the TOC">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
</p>
!! end
+!!test
+Disable TOC
+!! options
+notoc
+!! input
+Lead
+== Section 1 ==
+== Section 2 ==
+== Section 3 ==
+== Section 4 ==
+== Section 5 ==
+!! result
+<p>Lead
+</p>
+
+<h2><span class="mw-headline" id="Section_1">Section 1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: Section 1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<h2><span class="mw-headline" id="Section_2">Section 2</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: Section 2">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<h2><span class="mw-headline" id="Section_3">Section 3</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=3" title="Edit section: Section 3">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<h2><span class="mw-headline" id="Section_4">Section 4</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=4" title="Edit section: Section 4">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<h2><span class="mw-headline" id="Section_5">Section 5</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=5" title="Edit section: Section 5">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+
+!! end
+
###
### Parsoids-specific tests
*/
class ArticleTablesTest extends MediaWikiLangTestCase {
- function testbug14404() {
+ /**
+ * @covers Title::getTemplateLinksFrom
+ * @covers Title::getLinksFrom
+ */
+ public function testbug14404() {
global $wgContLang, $wgLanguageCode, $wgLang;
$title = Title::newFromText( 'Bug 14404' );
$this->article = null;
}
- function testImplementsGetMagic() {
+ /**
+ * @covers Article::__get
+ */
+ public function testImplementsGetMagic() {
$this->assertEquals( false, $this->article->mLatest, "Article __get magic" );
}
/**
* @depends testImplementsGetMagic
+ * @covers Article::__set
*/
- function testImplementsSetMagic() {
+ public function testImplementsSetMagic() {
$this->article->mLatest = 2;
$this->assertEquals( 2, $this->article->mLatest, "Article __set magic" );
}
/**
* @depends testImplementsSetMagic
+ * @covers Article::__call
*/
- function testImplementsCallMagic() {
+ public function testImplementsCallMagic() {
$this->article->mLatest = 33;
$this->article->mDataLoaded = true;
$this->assertEquals( 33, $this->article->getLatest(), "Article __call magic" );
}
- function testGetOrSetOnNewProperty() {
+ /**
+ * @covers Article::__get
+ * @covers Article::__set
+ */
+ public function testGetOrSetOnNewProperty() {
$this->article->ext_someNewProperty = 12;
$this->assertEquals( 12, $this->article->ext_someNewProperty,
"Article get/set magic on new field" );
/**
* Checks for the existence of the backwards compatibility static functions (forwarders to WikiPage class)
+ * @covers Article::selectFields
+ * @covers Article::onArticleCreate
+ * @covers Article::onArticleDelete
+ * @covers Article::onArticleEdit
+ * @covers Article::getAutosummary
*/
- function testStaticFunctions() {
+ public function testStaticFunctions() {
$this->hideDeprecated( 'Article::getAutosummary' );
$this->hideDeprecated( 'WikiPage::getAutosummary' );
$this->hideDeprecated( 'CategoryPage::getAutosummary' ); // Inherited from Article
$this->assertTrue( is_string( CategoryPage::getAutosummary( '', '', 0 ) ),
"Article static functions" );
}
-
- function testWikiPageFactory() {
- $title = Title::makeTitle( NS_FILE, 'Someimage.png' );
- $page = WikiPage::factory( $title );
- $this->assertEquals( 'WikiFilePage', get_class( $page ) );
-
- $title = Title::makeTitle( NS_CATEGORY, 'SomeCategory' );
- $page = WikiPage::factory( $title );
- $this->assertEquals( 'WikiCategoryPage', get_class( $page ) );
-
- $title = Title::makeTitle( NS_MAIN, 'SomePage' );
- $page = WikiPage::factory( $title );
- $this->assertEquals( 'WikiPage', get_class( $page ) );
- }
}
*/
class BlockTest extends MediaWikiLangTestCase {
- private $block, $madeAt;
+ /** @var Block */
+ private $block;
+ private $madeAt;
/* variable used to save up the blockID we insert in this test suite */
private $blockId;
}
}
- function testInitializerFunctionsReturnCorrectBlock() {
- // $this->dumpBlocks();
-
+ /**
+ * @covers Block::newFromTarget
+ */
+ public function testINewFromTargetReturnsCorrectBlock() {
$this->assertTrue( $this->block->equals( Block::newFromTarget( 'UTBlockee' ) ), "newFromTarget() returns the same block as the one that was made" );
+ }
+ /**
+ * @covers Block::newFromID
+ */
+ public function testINewFromIDReturnsCorrectBlock() {
$this->assertTrue( $this->block->equals( Block::newFromID( $this->blockId ) ), "newFromID() returns the same block as the one that was made" );
}
/**
* per bug 26425
*/
- function testBug26425BlockTimestampDefaultsToTime() {
+ public function testBug26425BlockTimestampDefaultsToTime() {
// delta to stop one-off errors when things happen to go over a second mark.
$delta = abs( $this->madeAt - $this->block->mTimestamp );
$this->assertLessThan( 2, $delta, "If no timestamp is specified, the block is recorded as time()" );
* This stopped working with r84475 and friends: regression being fixed for bug 29116.
*
* @dataProvider provideBug29116Data
+ * @covers Block::load
*/
- function testBug29116LoadWithEmptyIp( $vagueTarget ) {
+ public function testBug29116LoadWithEmptyIp( $vagueTarget ) {
$this->hideDeprecated( 'Block::load' );
$uid = User::idFromName( 'UTBlockee' );
* had. Regression bug 29116.
*
* @dataProvider provideBug29116Data
+ * @covers Block::newFromTarget
*/
- function testBug29116NewFromTargetWithEmptyIp( $vagueTarget ) {
+ public function testBug29116NewFromTargetWithEmptyIp( $vagueTarget ) {
$block = Block::newFromTarget( 'UTBlockee', $vagueTarget );
$this->assertTrue( $this->block->equals( $block ), "newFromTarget() returns the same block as the one that was made when given empty vagueTarget param " . var_export( $vagueTarget, true ) );
}
);
}
- function testBlockedUserCanNotCreateAccount() {
+ /**
+ * @covers Block::prevents
+ */
+ public function testBlockedUserCanNotCreateAccount() {
$username = 'BlockedUserToCreateAccountWith';
$u = User::newFromName( $username );
$u->setPassword( 'NotRandomPass' );
);
}
- function testCrappyCrossWikiBlocks() {
+ /**
+ * @covers Block::insert
+ */
+ public function testCrappyCrossWikiBlocks() {
// Delete the last round's block if it's still there
$oldBlock = Block::newFromTarget( 'UserOnForeignWiki' );
if ( $oldBlock ) {
/**
* @dataProvider providerXff
+ * @covers Block::getBlocksForIPList
+ * @covers Block::chooseBlock
*/
- function testBlocksOnXff( $xff, $exCount, $exResult ) {
+ public function testBlocksOnXff( $xff, $exCount, $exResult ) {
$list = array_map( 'trim', explode( ',', $xff ) );
$xffblocks = Block::getBlocksForIPList( $list, true );
$this->assertEquals( $exCount, count( $xffblocks ), 'Number of blocks for ' . $xff );
/**
* Test the CDB reader/writer
+ * @covers CdbWriter_PHP
+ * @covers CdbWriter_DBA
*/
class CdbTest extends MediaWikiTestCase {
<?php
+
+/**
+ * Class CollationTest
+ * @covers Collation
+ * @covers IcuCollation
+ * @covers IdentityCollation
+ * @covers UppercaseCollation
+ */
class CollationTest extends MediaWikiLangTestCase {
protected function setUp() {
parent::setUp();
*
* @dataProvider prefixDataProvider
*/
- function testIsPrefix( $lang, $base, $extended ) {
+ public function testIsPrefix( $lang, $base, $extended ) {
$cp = Collator::create( $lang );
$cp->setStrength( Collator::PRIMARY );
$baseBin = $cp->getSortKey( $base );
$this->assertStringStartsWith( $baseBin, $extendedBin, "$base is not a prefix of $extended" );
}
- function prefixDataProvider() {
+ public static function prefixDataProvider() {
return array(
array( 'en', 'A', 'AA' ),
array( 'en', 'A', 'AAA' ),
*
* @dataProvider notPrefixDataProvider
*/
- function testNotIsPrefix( $lang, $base, $extended ) {
+ public function testNotIsPrefix( $lang, $base, $extended ) {
$cp = Collator::create( $lang );
$cp->setStrength( Collator::PRIMARY );
$baseBin = $cp->getSortKey( $base );
$this->assertStringStartsNotWith( $baseBin, $extendedBin, "$base is a prefix of $extended" );
}
- function notPrefixDataProvider() {
+ public static function notPrefixDataProvider() {
return array(
array( 'en', 'A', 'B' ),
array( 'en', 'AC', 'ABC' ),
*
* @dataProvider firstLetterProvider
*/
- function testGetFirstLetter( $collation, $string, $firstLetter ) {
+ public function testGetFirstLetter( $collation, $string, $firstLetter ) {
$col = Collation::factory( $collation );
$this->assertEquals( $firstLetter, $col->getFirstLetter( $string ) );
}
/**
* Test for DiffHistoryBlob::xdiffAdler32()
* @dataProvider provideXdiffAdler32
+ * @covers DiffHistoryBlob::xdiffAdler32
*/
- function testXdiffAdler32( $input ) {
+ public function testXdiffAdler32( $input ) {
$xdiffHash = substr( xdiff_string_rabdiff( $input, '' ), 0, 4 );
$dhb = new DiffHistoryBlob;
$myHash = $dhb->xdiffAdler32( $input );
/**
* @dataProvider provideExtractSectionTitle
+ * @covers EditPage::extractSectionTitle
*/
- function testExtractSectionTitle( $section, $title ) {
+ public function testExtractSectionTitle( $section, $title ) {
$extracted = EditPage::extractSectionTitle( $section );
$this->assertEquals( $title, $extracted );
}
* wrapper around assertEquals() which calls rrtrim() to normalize the
* expected and actual texts.
*/
- function assertEditedTextEquals( $expected, $actual, $msg = '' ) {
+ protected function assertEditedTextEquals( $expected, $actual, $msg = '' ) {
return $this->assertEquals( rtrim( $expected ), rtrim( $actual ), $msg );
}
return $page;
}
+ /**
+ * @todo split into a dataprovider and test method
+ * @covers EditPage
+ */
public function testCreatePage() {
$this->assertEdit(
'EditPageTest_testCreatePage',
/**
* @dataProvider provideSectionEdit
+ * @covers EditPage
*/
public function testSectionEdit( $base, $section, $text, $summary, $expected ) {
$edit = array(
/**
* @dataProvider provideAutoMerge
+ * @covers EditPage
*/
public function testAutoMerge( $baseUser, $text, $adamsEdit, $bertasEdit,
$expectedCode, $expectedText, $message = null
class ExternalStoreTest extends MediaWikiTestCase {
- function testExternalFetchFromURL() {
+ /**
+ * @covers ExternalStore::fetchFromURL
+ */
+ public function testExternalFetchFromURL() {
$this->setMwGlobals( 'wgExternalStores', false );
$this->assertFalse(
*/
class ExtraParserTest extends MediaWikiTestCase {
+ /** @var ParserOptions */
+ protected $options;
+ /** @var Parser */
+ protected $parser;
+
protected function setUp() {
parent::setUp();
MagicWord::clearCache();
}
- // Bug 8689 - Long numeric lines kill the parser
- function testBug8689() {
+ /**
+ * Bug 8689 - Long numeric lines kill the parser
+ * @covers Parser::parse
+ */
+ public function testBug8689() {
global $wgUser;
$longLine = '1.' . str_repeat( '1234567890', 100000 ) . "\n";
$this->parser->parse( $longLine, $t, $options )->getText() );
}
- /* Test the parser entry points */
- function testParse() {
+ /**
+ * Test the parser entry points
+ * @covers Parser::parse
+ */
+ public function testParse() {
$title = Title::newFromText( __FUNCTION__ );
$parserOutput = $this->parser->parse( "Test\n{{Foo}}\n{{Bar}}", $title, $this->options );
$this->assertEquals( "<p>Test\nContent of <i>Template:Foo</i>\nContent of <i>Template:Bar</i>\n</p>", $parserOutput->getText() );
}
- function testPreSaveTransform() {
+ /**
+ * @covers Parser::preSaveTransform
+ */
+ public function testPreSaveTransform() {
global $wgUser;
$title = Title::newFromText( __FUNCTION__ );
$outputText = $this->parser->preSaveTransform( "Test\r\n{{subst:Foo}}\n{{Bar}}", $title, $wgUser, $this->options );
$this->assertEquals( "Test\nContent of ''Template:Foo''\n{{Bar}}", $outputText );
}
- function testPreprocess() {
+ /**
+ * @covers Parser::preprocess
+ */
+ public function testPreprocess() {
$title = Title::newFromText( __FUNCTION__ );
$outputText = $this->parser->preprocess( "Test\n{{Foo}}\n{{Bar}}", $title, $this->options );
/**
* cleanSig() makes all templates substs and removes tildes
+ * @covers Parser::cleanSig
*/
- function testCleanSig() {
+ public function testCleanSig() {
$title = Title::newFromText( __FUNCTION__ );
$outputText = $this->parser->cleanSig( "{{Foo}} ~~~~" );
/**
* cleanSig() should do nothing if disabled
+ * @covers Parser::cleanSig
*/
- function testCleanSigDisabled() {
+ public function testCleanSigDisabled() {
$this->setMwGlobals( 'wgCleanSignatures', false );
$title = Title::newFromText( __FUNCTION__ );
/**
* cleanSigInSig() just removes tildes
* @dataProvider provideStringsForCleanSigInSig
+ * @covers Parser::cleanSigInSig
*/
- function testCleanSigInSig( $in, $out ) {
+ public function testCleanSigInSig( $in, $out ) {
$this->assertEquals( Parser::cleanSigInSig( $in ), $out );
}
);
}
- function testGetSection() {
+ /**
+ * @covers Parser::getSection
+ */
+ public function testGetSection() {
$outputText2 = $this->parser->getSection( "Section 0\n== Heading 1 ==\nSection 1\n=== Heading 2 ===\nSection 2\n== Heading 3 ==\nSection 3\n", 2 );
$outputText1 = $this->parser->getSection( "Section 0\n== Heading 1 ==\nSection 1\n=== Heading 2 ===\nSection 2\n== Heading 3 ==\nSection 3\n", 1 );
$this->assertEquals( "== Heading 1 ==\nSection 1\n=== Heading 2 ===\nSection 2", $outputText1 );
}
- function testReplaceSection() {
+ /**
+ * @covers Parser::replaceSection
+ */
+ public function testReplaceSection() {
$outputText = $this->parser->replaceSection( "Section 0\n== Heading 1 ==\nSection 1\n=== Heading 2 ===\nSection 2\n== Heading 3 ==\nSection 3\n", 1, "New section 1" );
$this->assertEquals( "Section 0\nNew section 1\n\n== Heading 3 ==\nSection 3", $outputText );
/**
* Templates and comments are not affected, but noinclude/onlyinclude is.
+ * @covers Parser::getPreloadText
*/
- function testGetPreloadText() {
+ public function testGetPreloadText() {
$title = Title::newFromText( __FUNCTION__ );
$outputText = $this->parser->getPreloadText( "{{Foo}}<noinclude> censored</noinclude> information <!-- is very secret -->", $title, $this->options );
/**
* @group Database
+ * @covers Parser::parse
*/
- function testTrackingCategory() {
+ public function testTrackingCategory() {
$title = Title::newFromText( __FUNCTION__ );
$catName = wfMessage( 'broken-file-category' )->inContentLanguage()->text();
$cat = Title::makeTitleSafe( NS_CATEGORY, $catName );
/**
* @group Database
+ * @covers Parser::parse
*/
- function testTrackingCategorySpecial() {
+ public function testTrackingCategorySpecial() {
// Special pages shouldn't have tracking cats.
$title = SpecialPage::getTitleFor( 'Contributions' );
$parserOutput = $this->parser->parse( "[[file:nonexistent]]", $title, $this->options );
--- /dev/null
+<?php
+
+/**
+ * @covers Fallback
+ */
+class FallbackTest extends MediaWikiTestCase {
+
+ public function testFallbackMbstringFunctions() {
+
+ if ( !extension_loaded( 'mbstring' ) ) {
+ $this->markTestSkipped( "The mb_string functions must be installed to test the fallback functions" );
+ }
+
+ $sampleUTF = "Östergötland_coat_of_arms.png";
+
+ //mb_substr
+ $substr_params = array(
+ array( 0, 0 ),
+ array( 5, -4 ),
+ array( 33 ),
+ array( 100, -5 ),
+ array( -8, 10 ),
+ array( 1, 1 ),
+ array( 2, -1 )
+ );
+
+ foreach ( $substr_params as $param_set ) {
+ $old_param_set = $param_set;
+ array_unshift( $param_set, $sampleUTF );
+
+ $this->assertEquals(
+ call_user_func_array( 'mb_substr', $param_set ),
+ call_user_func_array( 'Fallback::mb_substr', $param_set ),
+ 'Fallback mb_substr with params ' . implode( ', ', $old_param_set )
+ );
+ }
+
+ //mb_strlen
+ $this->assertEquals(
+ mb_strlen( $sampleUTF ),
+ Fallback::mb_strlen( $sampleUTF ),
+ 'Fallback mb_strlen'
+ );
+
+ //mb_str(r?)pos
+ $strpos_params = array(
+ //array( 'ter' ),
+ //array( 'Ö' ),
+ //array( 'Ö', 3 ),
+ //array( 'oat_', 100 ),
+ //array( 'c', -10 ),
+ //Broken for now
+ );
+
+ foreach ( $strpos_params as $param_set ) {
+ $old_param_set = $param_set;
+ array_unshift( $param_set, $sampleUTF );
+
+ $this->assertEquals(
+ call_user_func_array( 'mb_strpos', $param_set ),
+ call_user_func_array( 'Fallback::mb_strpos', $param_set ),
+ 'Fallback mb_strpos with params ' . implode( ', ', $old_param_set )
+ );
+
+ $this->assertEquals(
+ call_user_func_array( 'mb_strrpos', $param_set ),
+ call_user_func_array( 'Fallback::mb_strrpos', $param_set ),
+ 'Fallback mb_strrpos with params ' . implode( ', ', $old_param_set )
+ );
+ }
+ }
+
+}
\ No newline at end of file
class FauxRequestTest extends MediaWikiTestCase {
- function testGetSetHeader() {
+ /**
+ * @covers FauxRequest::setHeader
+ * @covers FauxRequest::getHeader
+ */
+ public function testGetSetHeader() {
$value = 'test/test';
$request = new FauxRequest();
*/
class FauxResponseTest extends MediaWikiTestCase {
- var $response;
+ /** @var FauxResponse */
+ protected $response;
protected function setUp() {
parent::setUp();
$this->response = new FauxResponse;
}
- function testCookie() {
+ /**
+ * @covers FauxResponse::getcookie
+ * @covers FauxResponse::setcookie
+ */
+ public function testCookie() {
$this->assertEquals( null, $this->response->getcookie( 'key' ), 'Non-existing cookie' );
$this->response->setcookie( 'key', 'val' );
$this->assertEquals( 'val', $this->response->getcookie( 'key' ), 'Existing cookie' );
}
- function testHeader() {
+ /**
+ * @covers FauxResponse::getheader
+ * @covers FauxResponse::header
+ */
+ public function testHeader() {
$this->assertEquals( null, $this->response->getheader( 'Location' ), 'Non-existing header' );
$this->response->header( 'Location: http://localhost/' );
$this->assertEquals( 'http://localhost/', $this->response->getheader( 'LOCATION' ), 'Get header case insensitive' );
}
- function testResponseCode() {
+ /**
+ * @covers FauxResponse::getStatusCode
+ */
+ public function testResponseCode() {
$this->response->header( 'HTTP/1.1 200' );
$this->assertEquals( 200, $this->response->getStatusCode(), 'Header with no message' );
*/
protected $object;
-
/**
* A new fresh and empty FormOptions object to test initialization
* with.
$this->object = new FormOptionsExposed();
}
+ /**
+ * @covers FormOptionsExposed::add
+ */
public function testAddStringOption() {
$this->object->add( 'foo', 'string value' );
$this->assertEquals(
);
}
+ /**
+ * @covers FormOptionsExposed::add
+ */
public function testAddIntegers() {
$this->object->add( 'one', 1 );
$this->object->add( 'negone', -1 );
/**
* Reuse helpers above assertGuessBoolean assertGuessInt assertGuessString
+ * @covers FormOptions::guessType
*/
public function testGuessTypeDetection() {
$this->assertGuessBoolean( true );
/**
* @expectedException MWException
+ * @covers FormOptions::guessType
*/
public function testGuessTypeOnArrayThrowException() {
$this->object->guessType( array( 'foo' ) );
}
/**
* @expectedException MWException
+ * @covers FormOptions::guessType
*/
public function testGuessTypeOnNullThrowException() {
$this->object->guessType( null );
parent::tearDown();
}
- /** @dataProvider provideForWfArrayDiff2 */
+ /**
+ * @dataProvider provideForWfArrayDiff2
+ * @covers ::wfArrayDiff2
+ */
public function testWfArrayDiff2( $a, $b, $expected ) {
$this->assertEquals(
wfArrayDiff2( $a, $b ), $expected
);
}
- function testRandom() {
+ /**
+ * @covers ::wfRandom
+ */
+ public function testRandom() {
# This could hypothetically fail, but it shouldn't ;)
$this->assertFalse(
wfRandom() == wfRandom() );
}
- function testUrlencode() {
+ /**
+ * @covers ::wfUrlencode
+ */
+ public function testUrlencode() {
$this->assertEquals(
"%E7%89%B9%E5%88%A5:Contributions/Foobar",
wfUrlencode( "\xE7\x89\xB9\xE5\x88\xA5:Contributions/Foobar" ) );
}
- function testExpandIRI() {
+ /**
+ * @covers ::wfExpandIRI
+ */
+ public function testExpandIRI() {
$this->assertEquals(
"https://te.wikibooks.org/wiki/ఉబుంటు_వాడుకరి_మార్గదర్శని",
wfExpandIRI( "https://te.wikibooks.org/wiki/%E0%B0%89%E0%B0%AC%E0%B1%81%E0%B0%82%E0%B0%9F%E0%B1%81_%E0%B0%B5%E0%B0%BE%E0%B0%A1%E0%B1%81%E0%B0%95%E0%B0%B0%E0%B0%BF_%E0%B0%AE%E0%B0%BE%E0%B0%B0%E0%B1%8D%E0%B0%97%E0%B0%A6%E0%B0%B0%E0%B1%8D%E0%B0%B6%E0%B0%A8%E0%B0%BF" ) );
}
- function testReadOnlyEmpty() {
+ /**
+ * @covers ::wfReadOnly
+ */
+ public function testReadOnlyEmpty() {
global $wgReadOnly;
$wgReadOnly = null;
$this->assertFalse( wfReadOnly() );
}
- function testReadOnlySet() {
+ /**
+ * @covers ::wfReadOnly
+ */
+ public function testReadOnlySet() {
global $wgReadOnly, $wgReadOnlyFile;
$f = fopen( $wgReadOnlyFile, "wt" );
$this->assertFalse( wfReadOnly() );
}
- function testQuotedPrintable() {
- $this->assertEquals(
- "=?UTF-8?Q?=C4=88u=20legebla=3F?=",
- UserMailer::quotedPrintable( "\xc4\x88u legebla?", "UTF-8" ) );
- }
-
public static function provideArrayToCGI() {
return array(
array( array(), '' ), // empty
/**
* @dataProvider provideArrayToCGI
+ * @covers ::wfArrayToCgi
*/
- function testArrayToCGI( $array, $result ) {
+ public function testArrayToCGI( $array, $result ) {
$this->assertEquals( $result, wfArrayToCgi( $array ) );
}
- function testArrayToCGI2() {
+ /**
+ * @covers ::testWfArrayDiff2
+ */
+ public function testArrayToCGI2() {
$this->assertEquals(
"baz=bar&foo=bar",
wfArrayToCgi(
/**
* @dataProvider provideCgiToArray
+ * @covers ::wfCgiToArray
*/
- function testCgiToArray( $cgi, $result ) {
+ public function testCgiToArray( $cgi, $result ) {
$this->assertEquals( $result, wfCgiToArray( $cgi ) );
}
/**
* @dataProvider provideCgiRoundTrip
+ * @covers ::wfArrayToCgi
*/
- function testCgiRoundTrip( $cgi ) {
+ public function testCgiRoundTrip( $cgi ) {
$this->assertEquals( $cgi, wfArrayToCgi( wfCgiToArray( $cgi ) ) );
}
- function testMimeTypeMatch() {
+ /**
+ * @covers ::mimeTypeMatch
+ */
+ public function testMimeTypeMatch() {
$this->assertEquals(
'text/html',
mimeTypeMatch( 'text/html',
'image/svg+xml' => 0.5 ) ) );
}
- function testNegotiateType() {
+ /**
+ * @covers ::wfNegotiateType
+ */
+ public function testNegotiateType() {
$this->assertEquals(
'text/html',
wfNegotiateType(
array( 'application/xhtml+xml' => 1.0 ) ) );
}
- function testFallbackMbstringFunctions() {
-
- if ( !extension_loaded( 'mbstring' ) ) {
- $this->markTestSkipped( "The mb_string functions must be installed to test the fallback functions" );
- }
-
- $sampleUTF = "Östergötland_coat_of_arms.png";
-
- //mb_substr
- $substr_params = array(
- array( 0, 0 ),
- array( 5, -4 ),
- array( 33 ),
- array( 100, -5 ),
- array( -8, 10 ),
- array( 1, 1 ),
- array( 2, -1 )
- );
-
- foreach ( $substr_params as $param_set ) {
- $old_param_set = $param_set;
- array_unshift( $param_set, $sampleUTF );
-
- $this->assertEquals(
- call_user_func_array( 'mb_substr', $param_set ),
- call_user_func_array( 'Fallback::mb_substr', $param_set ),
- 'Fallback mb_substr with params ' . implode( ', ', $old_param_set )
- );
- }
-
- //mb_strlen
- $this->assertEquals(
- mb_strlen( $sampleUTF ),
- Fallback::mb_strlen( $sampleUTF ),
- 'Fallback mb_strlen'
- );
-
- //mb_str(r?)pos
- $strpos_params = array(
- //array( 'ter' ),
- //array( 'Ö' ),
- //array( 'Ö', 3 ),
- //array( 'oat_', 100 ),
- //array( 'c', -10 ),
- //Broken for now
- );
-
- foreach ( $strpos_params as $param_set ) {
- $old_param_set = $param_set;
- array_unshift( $param_set, $sampleUTF );
-
- $this->assertEquals(
- call_user_func_array( 'mb_strpos', $param_set ),
- call_user_func_array( 'Fallback::mb_strpos', $param_set ),
- 'Fallback mb_strpos with params ' . implode( ', ', $old_param_set )
- );
-
- $this->assertEquals(
- call_user_func_array( 'mb_strrpos', $param_set ),
- call_user_func_array( 'Fallback::mb_strrpos', $param_set ),
- 'Fallback mb_strrpos with params ' . implode( ', ', $old_param_set )
- );
- }
- }
-
-
- function testDebugFunctionTest() {
+ /**
+ * @covers ::wfDebug
+ * @covers ::wfDebugMem
+ */
+ public function testDebugFunctionTest() {
global $wgDebugLogFile, $wgDebugTimestamps;
$wgDebugTimestamps = $old_wgDebugTimestamps;
}
- function testClientAcceptsGzipTest() {
+ /**
+ * @covers ::wfClientAcceptsGzip
+ */
+ public function testClientAcceptsGzipTest() {
$settings = array(
'gzip' => true,
}
}
- function testSwapVarsTest() {
+ /**
+ * @covers ::swap
+ */
+ public function testSwapVarsTest() {
$var1 = 1;
$var2 = 2;
$this->assertEquals( $var2, 1, 'var2 is swapped' );
}
- function testWfPercentTest() {
+ /**
+ * @covers ::wfPercent
+ */
+ public function testWfPercentTest() {
$pcts = array(
array( 6 / 7, '0.86%', 2, false ),
/**
* test @see wfShorthandToInteger()
* @dataProvider provideShorthand
+ * @covers ::wfShorthandToInteger
*/
public function testWfShorthandToInteger( $shorthand, $expected ) {
$this->assertEquals( $expected,
*
* @dataProvider provideMerge()
* @group medium
+ * @covers ::wfMerge
*/
public function testMerge( $old, $mine, $yours, $expectedMergeResult, $expectedText ) {
$this->checkHasDiff3();
/**
* @dataProvider provideMakeUrlIndexes()
+ * @covers ::wfMakeUrlIndexes
*/
- function testMakeUrlIndexes( $url, $expected ) {
+ public function testMakeUrlIndexes( $url, $expected ) {
$index = wfMakeUrlIndexes( $url );
$this->assertEquals( $expected, $index, "wfMakeUrlIndexes(\"$url\")" );
}
/**
* @dataProvider provideWfMatchesDomainList
+ * @covers ::wfMatchesDomainList
*/
- function testWfMatchesDomainList( $url, $domains, $expected, $description ) {
+ public function testWfMatchesDomainList( $url, $domains, $expected, $description ) {
$actual = wfMatchesDomainList( $url, $domains );
$this->assertEquals( $expected, $actual, $description );
}
return $a;
}
- function testWfMkdirParents() {
+ /**
+ * @covers ::wfMkdirParents
+ */
+ public function testWfMkdirParents() {
// Should not return true if file exists instead of directory
$fname = $this->getNewTempFile();
wfSuppressWarnings();
/**
* @dataProvider provideWfShellMaintenanceCmdList
+ * @covers ::wfShellMaintenanceCmd
*/
- function testWfShellMaintenanceCmd( $script, $parameters, $options, $expected, $description ) {
+ public function testWfShellMaintenanceCmd( $script, $parameters, $options, $expected, $description ) {
if ( wfIsWindows() ) {
// Approximation that's good enough for our purposes just now
$expected = str_replace( "'", '"', $expected );
"Called eval.php --help --test with wrapper and php option" ),
);
}
- /* TODO: many more! */
+ /* @TODO many more! */
}
class GlobalWithDBTest extends MediaWikiTestCase {
/**
* @dataProvider provideWfIsBadImageList
+ * @covers ::wfIsBadImage
*/
- function testWfIsBadImage( $name, $title, $blacklist, $expected, $desc ) {
+ public function testWfIsBadImage( $name, $title, $blacklist, $expected, $desc ) {
$this->assertEquals( $expected, wfIsBadImage( $name, $title, $blacklist ), $desc );
}
<?php
/**
- * Tests for wfAssembleUrl()
+ * @covers ::wfAssembleUrl
*/
class WfAssembleUrlTest extends MediaWikiTestCase {
- /** @dataProvider provideURLParts */
+ /**
+ * @dataProvider provideURLParts
+ */
public function testWfAssembleUrl( $parts, $output ) {
$partsDump = print_r( $parts, true );
$this->assertEquals(
<?php
/**
- * Tests for wfBCP47()
+ * @covers ::wfBCP47
*/
class WfBCP47Test extends MediaWikiTestCase {
/**
* @see http://tools.ietf.org/html/bcp47
* @dataProvider provideLanguageCodes()
*/
- function testBCP47( $code, $expected ) {
+ public function testBCP47( $code, $expected ) {
$code = strtolower( $code );
$this->assertEquals( $expected, wfBCP47( $code ),
"Applying BCP47 standard to lower case '$code'"
<?php
/**
- * Tests for wfBaseConvert()
+ * @covers ::wfBaseConvert
*/
class WfBaseConvertTest extends MediaWikiTestCase {
public static function provideSingleDigitConversions() {
<?php
/**
- * Tests for wfBaseName()
+ * @covers ::wfBaseName
*/
class WfBaseNameTest extends MediaWikiTestCase {
/**
* @dataProvider providePaths
*/
- function testBaseName( $fullpath, $basename ) {
+ public function testBaseName( $fullpath, $basename ) {
$this->assertEquals( $basename, wfBaseName( $fullpath ),
"wfBaseName('$fullpath') => '$basename'" );
}
<?php
/**
- * Tests for wfExpandUrl()
+ * @covers ::wfExpandUrl
*/
class WfExpandUrlTest extends MediaWikiTestCase {
- /** @dataProvider provideExpandableUrls */
+ /**
+ * @dataProvider provideExpandableUrls
+ */
public function testWfExpandUrl( $fullUrl, $shortUrl, $defaultProto, $server, $canServer, $httpsMode, $message ) {
// Fake $wgServer and $wgCanonicalServer
$this->setMwGlobals( array(
<?php
+/**
+ * @covers ::wfGetCaller
+ */
class WfGetCallerTest extends MediaWikiTestCase {
- function testZero() {
+ public function testZero() {
$this->assertEquals( __METHOD__, wfGetCaller( 1 ) );
}
return wfGetCaller();
}
- function testOne() {
+ public function testOne() {
$this->assertEquals( 'WfGetCallerTest::testOne', self::callerOne() );
}
return wfGetCaller( $level );
}
- function testTwo() {
+ public function testTwo() {
$this->assertEquals( 'WfGetCallerTest::testTwo', self::intermediateFunction() );
}
- function testN() {
+ public function testN() {
$this->assertEquals( 'WfGetCallerTest::testN', self::intermediateFunction( 2, 0 ) );
$this->assertEquals( 'WfGetCallerTest::intermediateFunction', self::intermediateFunction( 1, 0 ) );
<?php
/**
- * Tests for wfParseUrl()
- *
* Copyright © 2013 Alexandre Emsenhuber
*
* This program is free software; you can redistribute it and/or modify
* @file
*/
+/**
+ * @covers ::wfParseUrl
+ */
class WfParseUrlTest extends MediaWikiTestCase {
protected function setUp() {
parent::setUp();
) );
}
- /** @dataProvider provideURLs */
+ /**
+ * @dataProvider provideURLs
+ */
public function testWfParseUrl( $url, $parts ) {
$partsDump = var_export( $parts, true );
$this->assertEquals(
<?php
/**
- * Tests for wfRemoveDotSegments()
+ *@covers ::wfRemoveDotSegments
*/
class WfRemoveDotSegmentsTest extends MediaWikiTestCase {
- /** @dataProvider providePaths */
+ /**
+ * @dataProvider providePaths
+ */
public function testWfRemoveDotSegments( $inputPath, $outputPath ) {
$this->assertEquals(
$outputPath,
<?php
+/**
+ * @covers ::wfShorthandToInteger
+ */
class WfShorthandToIntegerTest extends MediaWikiTestCase {
/**
* @dataProvider provideABunchOfShorthands
*/
- function testWfShorthandToInteger( $input, $output, $description ) {
+ public function testWfShorthandToInteger( $input, $output, $description ) {
$this->assertEquals(
wfShorthandToInteger( $input ),
$output,
<?php
/*
- * Tests for wfTimestamp()
+ * @covers ::wfTimestamp
*/
class WfTimestampTest extends MediaWikiTestCase {
/**
* @dataProvider provideNormalTimestamps
*/
- function testNormalTimestamps( $input, $format, $output, $desc ) {
+ public function testNormalTimestamps( $input, $format, $output, $desc ) {
$this->assertEquals( $output, wfTimestamp( $format, $input ), $desc );
}
* See r74778 and bug 25451
* @dataProvider provideOldTimestamps
*/
- function testOldTimestamps( $input, $format, $output, $desc ) {
+ public function testOldTimestamps( $input, $format, $output, $desc ) {
$this->assertEquals( $output, wfTimestamp( $format, $input ), $desc );
}
* @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1
* @dataProvider provideHttpDates
*/
- function testHttpDate( $input, $output, $desc ) {
+ public function testHttpDate( $input, $output, $desc ) {
$this->assertEquals( $output, wfTimestamp( TS_MW, $input ), $desc );
}
* There are a number of assumptions in our codebase where wfTimestamp()
* should give the current date but it is not given a 0 there. See r71751 CR
*/
- function testTimestampParameter() {
+ public function testTimestampParameter() {
$now = wfTimestamp( TS_UNIX );
// We check that wfTimestamp doesn't return false (error) and use a LessThan assert
// for the cases where the test is run in a second boundary.
<?php
/**
- * Tests for wfUrlencode()
- *
* The function only need a string parameter and might react to IIS7.0
+ * @covers ::wfUrlencode
*/
class WfUrlencodeTest extends MediaWikiTestCase {
#### TESTS ##############################################################
- /** @dataProvider provideURLS */
+ /**
+ * @dataProvider provideURLS
+ */
public function testEncodingUrlWith( $input, $expected ) {
$this->verifyEncodingFor( 'Apache', $input, $expected );
}
- /** @dataProvider provideURLS */
+ /**
+ * @dataProvider provideURLS
+ */
public function testEncodingUrlWithMicrosoftIis7( $input, $expected ) {
$this->verifyEncodingFor( 'Microsoft-IIS/7', $input, $expected );
}
<?php
/**
- * Unit tests for the HTMLCheckMatrix form field
+ * Unit tests for the HTMLCheckMatrix + HTMLFormField
+ * @todo the tests for the two classes could be split up
*/
class HtmlCheckMatrixTest extends MediaWikiTestCase {
static private $defaultOptions = array(
'fieldname' => 'test',
);
+ /**
+ * @covers HTMLCheckMatrix::__construct
+ */
public function testPlainInstantiation() {
try {
$form = new HTMLCheckMatrix( array() );
$this->fail( 'Expected MWException indicating missing parameters but none was thrown.' );
}
+ /**
+ * @covers HTMLCheckMatrix::__construct
+ */
public function testInstantiationWithMinimumRequiredParameters() {
$form = new HTMLCheckMatrix( self::$defaultOptions );
$this->assertTrue( true ); // form instantiation must throw exception on failure
}
+ /**
+ * @covers HTMLFormField::validate
+ */
public function testValidateCallsUserDefinedValidationCallback() {
$called = false;
$field = new HTMLCheckMatrix( self::$defaultOptions + array(
$this->assertTrue( $called );
}
+ /**
+ * @covers HTMLFormField::validate
+ */
public function testValidateRequiresArrayInput() {
$field = new HTMLCheckMatrix( self::$defaultOptions );
$this->assertEquals( false, $this->validate( $field, null ) );
$this->assertEquals( true, $this->validate( $field, array() ) );
}
+ /**
+ * @covers HTMLFormField::validate
+ */
public function testValidateAllowsOnlyKnownTags() {
$field = new HTMLCheckMatrix( self::$defaultOptions );
$this->assertInternalType( 'string', $this->validate( $field, array( 'foo' ) ) );
}
+ /**
+ * @covers HTMLFormField::validate
+ */
public function testValidateAcceptsPartialTagList() {
$field = new HTMLCheckMatrix( self::$defaultOptions );
$this->assertTrue( $this->validate( $field, array() ) );
* foreach ( $field->filterDataForSubmit( $data ) as $k => $v ) {
* $user->setOption( $k, $v );
* }
+ * @covers HTMLFormField::filterDataForSubmit
*/
public function testValuesForcedOnRemainOn() {
$field = new HTMLCheckMatrix( self::$defaultOptions + array(
$this->assertEquals( $expected, $field->filterDataForSubmit( array() ) );
}
+ /**
+ * @covers HTMLFormField::filterDataForSubmit
+ */
public function testValuesForcedOffRemainOff() {
$field = new HTMLCheckMatrix( self::$defaultOptions + array(
'force-options-off' => array( 'c1-r2', 'c2-r2' ),
* @group HashRing
*/
class HashRingTest extends MediaWikiTestCase {
- function testHashRing() {
+ /**
+ * @covers HashRing
+ */
+ public function testHashRing() {
$ring = new HashRing( array( 's1' => 1, 's2' => 1, 's3' => 2, 's4' => 2, 's5' => 2, 's6' => 3 ) );
$locations = array();
/**
* @dataProvider provideHooks
+ * @covers ::wfRunHooks
*/
public function testOldStyleHooks( $msg, array $hook, $expectedFoo, $expectedBar ) {
global $wgHooks;
/**
* @dataProvider provideHooks
+ * @covers Hooks::register
+ * @covers Hooks::run
*/
public function testNewStyleHooks( $msg, $hook, $expectedFoo, $expectedBar ) {
$foo = $bar = 'original';
$this->assertSame( $expectedBar, $bar, $msg );
}
+ /**
+ * @covers Hooks::isRegistered
+ * @covers Hooks::register
+ * @covers Hooks::getHandlers
+ * @covers Hooks::run
+ */
public function testNewStyleHookInteraction() {
global $wgHooks;
/**
* @expectedException MWException
+ * @covers Hooks::run
*/
public function testUncallableFunction() {
Hooks::register( 'MediaWikiHooksTest001', 'ThisFunctionDoesntExist' );
Hooks::run( 'MediaWikiHooksTest001', array() );
}
+ /**
+ * @covers Hooks::run
+ */
public function testFalseReturn() {
Hooks::register( 'MediaWikiHooksTest001', function ( &$foo ) {
return false;
/**
* @expectedException FatalError
+ * @covers Hooks::run
*/
public function testFatalError() {
Hooks::register( 'MediaWikiHooksTest001', function () {
class HtmlFormatterTest extends MediaWikiTestCase {
/**
* @dataProvider getHtmlData
+ * @covers HtmlFormatter::getText
*/
public function testTransform( $input, $expected, $callback = false ) {
$input = self::normalize( $input );
) );
}
+ /**
+ * @covers Html::element
+ */
public function testElementBasics() {
$this->assertEquals(
'<img>',
/**
* @dataProvider dataXmlMimeType
+ * @covers Html::isXmlMimeType
*/
public function testXmlMimeType( $mimetype, $isXmlMimeType ) {
$this->assertEquals( $isXmlMimeType, Html::isXmlMimeType( $mimetype ) );
}
+ /**
+ * @covers HTML::expandAttributes
+ */
public function testExpandAttributesSkipsNullAndFalse() {
### EMPTY ########
);
}
+ /**
+ * @covers HTML::expandAttributes
+ */
public function testExpandAttributesForBooleans() {
$this->assertEquals(
'',
/**
* Test for Html::expandAttributes()
* Please note it output a string prefixed with a space!
+ * @covers Html::expandAttributes
*/
public function testExpandAttributesVariousExpansions() {
### NOT EMPTY ####
* Html::expandAttributes has special features for HTML
* attributes that use space separated lists and also
* allows arrays to be used as values.
+ * @covers Html::expandAttributes
*/
public function testExpandAttributesListValueAttributes() {
### STRING VALUES
/**
* Test feature added by r96188, let pass attributes values as
* a PHP array. Restricted to class,rel, accesskey.
+ * @covers Html::expandAttributes
*/
- function testExpandAttributesSpaceSeparatedAttributesWithBoolean() {
+ public function testExpandAttributesSpaceSeparatedAttributesWithBoolean() {
$this->assertEquals(
' class="booltrue one"',
Html::expandAttributes( array( 'class' => array(
* The later will take precedence.
*
* Feature added by r96188
+ * @covers Html::expandAttributes
*/
- function testValueIsAuthoritativeInSpaceSeparatedAttributesArrays() {
+ public function testValueIsAuthoritativeInSpaceSeparatedAttributesArrays() {
$this->assertEquals(
' class=""',
Html::expandAttributes( array( 'class' => array(
);
}
- function testNamespaceSelector() {
+ /**
+ * @covers Html::namespaceSelector
+ */
+ public function testNamespaceSelector() {
$this->assertEquals(
'<select id=namespace name=namespace>' . "\n" .
'<option value=0>(Main)</option>' . "\n" .
);
}
- function testCanFilterOutNamespaces() {
+ public function testCanFilterOutNamespaces() {
$this->assertEquals(
'<select id=namespace name=namespace>' . "\n" .
'<option value=2>User</option>' . "\n" .
);
}
- function testCanDisableANamespaces() {
+ public function testCanDisableANamespaces() {
$this->assertEquals(
'<select id=namespace name=namespace>' . "\n" .
'<option disabled value=0>(Main)</option>' . "\n" .
/**
* @dataProvider provideHtml5InputTypes
+ * @covers Html::element
*/
- function testHtmlElementAcceptsNewHtml5TypesInHtml5Mode( $HTML5InputType ) {
+ public function testHtmlElementAcceptsNewHtml5TypesInHtml5Mode( $HTML5InputType ) {
$this->assertEquals(
'<input type=' . $HTML5InputType . '>',
Html::element( 'input', array( 'type' => $HTML5InputType ) ),
* @covers Html::dropDefaults
* @dataProvider provideElementsWithAttributesHavingDefaultValues
*/
- function testDropDefaults( $expected, $element, $attribs, $message = '' ) {
+ public function testDropDefaults( $expected, $element, $attribs, $message = '' ) {
$this->assertEquals( $expected, Html::element( $element, $attribs ), $message );
}
return $ret;
}
+ /**
+ * @covers Html::expandAttributes
+ */
public function testFormValidationBlacklist() {
$this->assertEmpty(
Html::expandAttributes( array( 'min' => 1, 'max' => 100, 'pattern' => 'abc', 'required' => true, 'step' => 2 ) ),
* @dataProvider provideURI
* @covers Http::isValidURI
*/
- function testIsValidUri( $expect, $URI, $message = '' ) {
+ public function testIsValidUri( $expect, $URI, $message = '' ) {
$this->assertEquals(
$expect,
(bool)Http::isValidURI( $URI ),
* representing the network mask and the bit mask.
* @covers IP::parseCIDR
*/
- function testCIDRParsing() {
+ public function testCIDRParsing() {
$this->assertFalseCIDR( '192.0.2.0', "missing mask" );
$this->assertFalseCIDR( '192.0.2.0/', "missing bitmask" );
* Test for IP::splitHostAndPort().
* @dataProvider provideSplitHostAndPort
*/
- function testSplitHostAndPort( $expected, $input, $description ) {
+ public function testSplitHostAndPort( $expected, $input, $description ) {
$this->assertEquals( $expected, IP::splitHostAndPort( $input ), $description );
}
* Test for IP::combineHostAndPort()
* @dataProvider provideCombineHostAndPort
*/
- function testCombineHostAndPort( $expected, $input, $description ) {
+ public function testCombineHostAndPort( $expected, $input, $description ) {
list( $host, $port, $defaultPort ) = $input;
$this->assertEquals(
$expected,
* Test for IP::sanitizeRange()
* @dataProvider provideIPCIDRs
*/
- function testSanitizeRange( $input, $expected, $description ) {
+ public function testSanitizeRange( $input, $expected, $description ) {
$this->assertEquals( $expected, IP::sanitizeRange( $input ), $description );
}
* Test for IP::prettifyIP()
* @dataProvider provideIPsToPrettify
*/
- function testPrettifyIP( $ip, $prettified ) {
+ public function testPrettifyIP( $ip, $prettified ) {
$this->assertEquals( $prettified, IP::prettifyIP( $ip ), "Prettify of $ip" );
}
<?php
class LanguageConverterTest extends MediaWikiLangTestCase {
+ /** @var LanguageToTest */
protected $lang = null;
+ /** @var TestConverter */
protected $lc = null;
protected function setUp() {
parent::tearDown();
}
- function testGetPreferredVariantDefaults() {
+ /**
+ * @covers LanguageConverter::getPreferredVariant
+ */
+ public function testGetPreferredVariantDefaults() {
$this->assertEquals( 'tg', $this->lc->getPreferredVariant() );
}
- function testGetPreferredVariantHeaders() {
+ /**
+ * @covers LanguageConverter::getPreferredVariant
+ * @covers LanguageConverter::getHeaderVariant
+ */
+ public function testGetPreferredVariantHeaders() {
global $wgRequest;
$wgRequest->setHeader( 'Accept-Language', 'tg-latn' );
$this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() );
}
- function testGetPreferredVariantHeaderWeight() {
+ /**
+ * @covers LanguageConverter::getPreferredVariant
+ * @covers LanguageConverter::getHeaderVariant
+ */
+ public function testGetPreferredVariantHeaderWeight() {
global $wgRequest;
$wgRequest->setHeader( 'Accept-Language', 'tg;q=1' );
$this->assertEquals( 'tg', $this->lc->getPreferredVariant() );
}
- function testGetPreferredVariantHeaderWeight2() {
+ /**
+ * @covers LanguageConverter::getPreferredVariant
+ * @covers LanguageConverter::getHeaderVariant
+ */
+ public function testGetPreferredVariantHeaderWeight2() {
global $wgRequest;
$wgRequest->setHeader( 'Accept-Language', 'tg-latn;q=1' );
$this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() );
}
- function testGetPreferredVariantHeaderMulti() {
+ /**
+ * @covers LanguageConverter::getPreferredVariant
+ * @covers LanguageConverter::getHeaderVariant
+ */
+ public function testGetPreferredVariantHeaderMulti() {
global $wgRequest;
$wgRequest->setHeader( 'Accept-Language', 'en, tg-latn;q=1' );
$this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() );
}
- function testGetPreferredVariantUserOption() {
+ /**
+ * @covers LanguageConverter::getPreferredVariant
+ */
+ public function testGetPreferredVariantUserOption() {
global $wgUser;
$wgUser = new User;
$this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() );
}
- function testGetPreferredVariantUserOptionForForeignLanguage() {
+ /**
+ * @covers LanguageConverter::getPreferredVariant
+ * @covers LanguageConverter::getUserVariant
+ */
+ public function testGetPreferredVariantUserOptionForForeignLanguage() {
global $wgContLang, $wgUser;
$wgContLang = Language::factory( 'en' );
$this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() );
}
- function testGetPreferredVariantHeaderUserVsUrl() {
+ /**
+ * @covers LanguageConverter::getPreferredVariant
+ * @covers LanguageConverter::getUserVariant
+ * @covers LanguageConverter::getURLVariant
+ */
+ public function testGetPreferredVariantHeaderUserVsUrl() {
global $wgContLang, $wgRequest, $wgUser;
$wgContLang = Language::factory( 'tg-latn' );
$this->assertEquals( 'tg', $this->lc->getPreferredVariant() );
}
-
- function testGetPreferredVariantDefaultLanguageVariant() {
+ /**
+ * @covers LanguageConverter::getPreferredVariant
+ */
+ public function testGetPreferredVariantDefaultLanguageVariant() {
global $wgDefaultLanguageVariant;
$wgDefaultLanguageVariant = 'tg-latn';
$this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() );
}
- function testGetPreferredVariantDefaultLanguageVsUrlVariant() {
+ /**
+ * @covers LanguageConverter::getPreferredVariant
+ * @covers LanguageConverter::getURLVariant
+ */
+ public function testGetPreferredVariantDefaultLanguageVsUrlVariant() {
global $wgDefaultLanguageVariant, $wgRequest, $wgContLang;
$wgContLang = Language::factory( 'tg-latn' );
<?php
+/**
+ * @covers Licenses
+ */
class LicensesTest extends MediaWikiTestCase {
- function testLicenses() {
+ public function testLicenses() {
$str = "
* Free licenses:
** GFDL|Debian disagrees
* @dataProvider provideCasesForUserLink
* @covers Linker::userLink
*/
- function testUserLink( $expected, $userId, $userName, $altUserName = false, $msg = '' ) {
+ public function testUserLink( $expected, $userId, $userName, $altUserName = false, $msg = '' ) {
$this->setMwGlobals( array(
'wgArticlePath' => '/wiki/$1',
'wgWellFormedXml' => true,
return array( $t, $po );
}
+ /**
+ * @covers LinksUpdate::addLink
+ */
public function testUpdate_pagelinks() {
list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 );
), $update->getRemovedLinks() );
}
+ /**
+ * @covers LinksUpdate::addExternalLink
+ */
public function testUpdate_externallinks() {
list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 );
) );
}
+ /**
+ * @covers LinksUpdate::addCategory
+ */
public function testUpdate_categorylinks() {
$this->setMwGlobals( 'wgCategoryCollation', 'uppercase' );
) );
}
+ /**
+ * @covers LinksUpdate::addInterwikiLink
+ */
public function testUpdate_iwlinks() {
list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 );
) );
}
+ /**
+ * @covers LinksUpdate::addTemplate
+ */
public function testUpdate_templatelinks() {
list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 );
) );
}
+ /**
+ * @covers LinksUpdate::addImage
+ */
public function testUpdate_imagelinks() {
list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 );
) );
}
+ /**
+ * @covers LinksUpdate::addLanguageLink
+ */
public function testUpdate_langlinks() {
list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 );
) );
}
+ /**
+ * @covers LinksUpdate::setProperty
+ */
public function testUpdate_page_props() {
list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 );
/**
* These tests should work regardless of $wgCapitalLinks
* @group Database
+ * @todo Split tests into providers and test methods
*/
class LocalFileTest extends MediaWikiTestCase {
$this->file_lc = $this->repo_lc->newFile( 'test!' );
}
- function testGetHashPath() {
+ /**
+ * @covers File::getHashPath
+ */
+ public function testGetHashPath() {
$this->assertEquals( '', $this->file_hl0->getHashPath() );
$this->assertEquals( 'a/a2/', $this->file_hl2->getHashPath() );
$this->assertEquals( 'c/c4/', $this->file_lc->getHashPath() );
}
- function testGetRel() {
+ /**
+ * @covers File::getRel
+ */
+ public function testGetRel() {
$this->assertEquals( 'Test!', $this->file_hl0->getRel() );
$this->assertEquals( 'a/a2/Test!', $this->file_hl2->getRel() );
$this->assertEquals( 'c/c4/test!', $this->file_lc->getRel() );
}
- function testGetUrlRel() {
+ /**
+ * @covers File::getUrlRel
+ */
+ public function testGetUrlRel() {
$this->assertEquals( 'Test%21', $this->file_hl0->getUrlRel() );
$this->assertEquals( 'a/a2/Test%21', $this->file_hl2->getUrlRel() );
$this->assertEquals( 'c/c4/test%21', $this->file_lc->getUrlRel() );
}
- function testGetArchivePath() {
+ /**
+ * @covers File::getArchivePath
+ */
+ public function testGetArchivePath() {
$this->assertEquals( 'mwstore://local-backend/test-public/archive', $this->file_hl0->getArchivePath() );
$this->assertEquals( 'mwstore://local-backend/test-public/archive/a/a2', $this->file_hl2->getArchivePath() );
$this->assertEquals( 'mwstore://local-backend/test-public/archive/!', $this->file_hl0->getArchivePath( '!' ) );
$this->assertEquals( 'mwstore://local-backend/test-public/archive/a/a2/!', $this->file_hl2->getArchivePath( '!' ) );
}
- function testGetThumbPath() {
+ /**
+ * @covers File::getThumbPath
+ */
+ public function testGetThumbPath() {
$this->assertEquals( 'mwstore://local-backend/test-thumb/Test!', $this->file_hl0->getThumbPath() );
$this->assertEquals( 'mwstore://local-backend/test-thumb/a/a2/Test!', $this->file_hl2->getThumbPath() );
$this->assertEquals( 'mwstore://local-backend/test-thumb/Test!/x', $this->file_hl0->getThumbPath( 'x' ) );
$this->assertEquals( 'mwstore://local-backend/test-thumb/a/a2/Test!/x', $this->file_hl2->getThumbPath( 'x' ) );
}
- function testGetArchiveUrl() {
+ /**
+ * @covers File::getArchiveUrl
+ */
+ public function testGetArchiveUrl() {
$this->assertEquals( '/testurl/archive', $this->file_hl0->getArchiveUrl() );
$this->assertEquals( '/testurl/archive/a/a2', $this->file_hl2->getArchiveUrl() );
$this->assertEquals( '/testurl/archive/%21', $this->file_hl0->getArchiveUrl( '!' ) );
$this->assertEquals( '/testurl/archive/a/a2/%21', $this->file_hl2->getArchiveUrl( '!' ) );
}
- function testGetThumbUrl() {
+ /**
+ * @covers File::getThumbUrl
+ */
+ public function testGetThumbUrl() {
$this->assertEquals( '/testurl/thumb/Test%21', $this->file_hl0->getThumbUrl() );
$this->assertEquals( '/testurl/thumb/a/a2/Test%21', $this->file_hl2->getThumbUrl() );
$this->assertEquals( '/testurl/thumb/Test%21/x', $this->file_hl0->getThumbUrl( 'x' ) );
$this->assertEquals( '/testurl/thumb/a/a2/Test%21/x', $this->file_hl2->getThumbUrl( 'x' ) );
}
- function testGetArchiveVirtualUrl() {
+ /**
+ * @covers File::getArchiveVirtualUrl
+ */
+ public function testGetArchiveVirtualUrl() {
$this->assertEquals( 'mwrepo://test/public/archive', $this->file_hl0->getArchiveVirtualUrl() );
$this->assertEquals( 'mwrepo://test/public/archive/a/a2', $this->file_hl2->getArchiveVirtualUrl() );
$this->assertEquals( 'mwrepo://test/public/archive/%21', $this->file_hl0->getArchiveVirtualUrl( '!' ) );
$this->assertEquals( 'mwrepo://test/public/archive/a/a2/%21', $this->file_hl2->getArchiveVirtualUrl( '!' ) );
}
- function testGetThumbVirtualUrl() {
+ /**
+ * @covers File::getThumbVirtualUrl
+ */
+ public function testGetThumbVirtualUrl() {
$this->assertEquals( 'mwrepo://test/thumb/Test%21', $this->file_hl0->getThumbVirtualUrl() );
$this->assertEquals( 'mwrepo://test/thumb/a/a2/Test%21', $this->file_hl2->getThumbVirtualUrl() );
$this->assertEquals( 'mwrepo://test/thumb/Test%21/%21', $this->file_hl0->getThumbVirtualUrl( '!' ) );
$this->assertEquals( 'mwrepo://test/thumb/a/a2/Test%21/%21', $this->file_hl2->getThumbVirtualUrl( '!' ) );
}
- function testGetUrl() {
+ /**
+ * @covers File::getUrl
+ */
+ public function testGetUrl() {
$this->assertEquals( '/testurl/Test%21', $this->file_hl0->getUrl() );
$this->assertEquals( '/testurl/a/a2/Test%21', $this->file_hl2->getUrl() );
}
- function testWfLocalFile() {
+ /**
+ * @covers ::wfLocalFile
+ */
+ public function testWfLocalFile() {
$file = wfLocalFile( "File:Some_file_that_probably_doesn't exist.png" );
$this->assertThat( $file, $this->isInstanceOf( 'LocalFile' ), 'wfLocalFile() returns LocalFile for valid Titles' );
}
<?php
+/**
+ * @covers LocalisationCache
+ */
class LocalisationCacheTest extends MediaWikiTestCase {
public function testPuralRulesFallback() {
$cache = Language::getLocalisationCache();
<?php
+/**
+ * @covers MWFunction
+ */
class MWFunctionTest extends MediaWikiTestCase {
- function testNewObjFunction() {
+ public function testNewObjFunction() {
$arg1 = 'Foo';
$arg2 = 'Bar';
$arg3 = array( 'Baz' );
/**
* Test class for MWNamespace.
* Generated by PHPUnit on 2011-02-20 at 21:01:55.
+ * @todo covers tags
+ * @FIXME this test file is a mess
*
*/
class MWNamespaceTest extends MediaWikiTestCase {
/**
* @todo Write more texts, handle $wgAllowImageMoving setting
+ * @covers MWNamespace::isMovable
*/
public function testIsMovable() {
$this->assertFalse( MWNamespace::isMovable( NS_CATEGORY ) );
/**
* Please make sure to change testIsTalk() if you change the assertions below
+ * @covers MWNamespace::isSubject
*/
public function testIsSubject() {
// Special namespaces
/**
* Reverse of testIsSubject().
* Please update testIsSubject() if you change assertions below
+ * @covers MWNamespace::isTalk
*/
public function testIsTalk() {
// Special namespaces
}
/**
+ * @covers MWNamespace::getSubject
*/
public function testGetSubject() {
// Special namespaces are their own subjects
* Regular getTalk() calls
* Namespaces without a talk page (NS_MEDIA, NS_SPECIAL) are tested in
* the function testGetTalkExceptions()
+ * @covers MWNamespace::getTalk
*/
public function testGetTalk() {
$this->assertEquals( NS_TALK, MWNamespace::getTalk( NS_MAIN ) );
* Exceptions with getTalk()
* NS_MEDIA does not have talk pages. MediaWiki raise an exception for them.
* @expectedException MWException
+ * @covers MWNamespace::getTalk
*/
public function testGetTalkExceptionsForNsMedia() {
$this->assertNull( MWNamespace::getTalk( NS_MEDIA ) );
* Exceptions with getTalk()
* NS_SPECIAL does not have talk pages. MediaWiki raise an exception for them.
* @expectedException MWException
+ * @covers MWNamespace::getTalk
*/
public function testGetTalkExceptionsForNsSpecial() {
$this->assertNull( MWNamespace::getTalk( NS_SPECIAL ) );
* Regular getAssociated() calls
* Namespaces without an associated page (NS_MEDIA, NS_SPECIAL) are tested in
* the function testGetAssociatedExceptions()
+ * @covers MWNamespace::getAssociated
*/
public function testGetAssociated() {
$this->assertEquals( NS_TALK, MWNamespace::getAssociated( NS_MAIN ) );
### an exception for them.
/**
* @expectedException MWException
+ * @covers MWNamespace::getAssociated
*/
public function testGetAssociatedExceptionsForNsMedia() {
$this->assertNull( MWNamespace::getAssociated( NS_MEDIA ) );
/**
* @expectedException MWException
+ * @covers MWNamespace::getAssociated
*/
public function testGetAssociatedExceptionsForNsSpecial() {
$this->assertNull( MWNamespace::getAssociated( NS_SPECIAL ) );
* Note if we add a namespace registration system with keys like 'MAIN'
* we should add tests here for equivilance on things like 'MAIN' == 0
* and 'MAIN' == NS_MAIN.
+ * @covers MWNamespace::equals
*/
public function testEquals() {
$this->assertTrue( MWNamespace::equals( NS_MAIN, NS_MAIN ) );
}
/**
- * Test MWNamespace::subjectEquals
+ * @covers MWNamespace::subjectEquals
*/
public function testSubjectEquals() {
$this->assertSameSubject( NS_MAIN, NS_MAIN );
$this->assertDifferentSubject( NS_SPECIAL, NS_MAIN );
}
+ /**
+ * @covers MWNamespace::subjectEquals
+ */
public function testSpecialAndMediaAreDifferentSubjects() {
$this->assertDifferentSubject(
NS_MEDIA, NS_SPECIAL,
*/
/**
+ * @covers MWNamespace::canTalk
*/
public function testCanTalk() {
$this->assertCanNotTalk( NS_MEDIA );
}
/**
+ * @covers MWNamespace::isContent
*/
public function testIsContent() {
// NS_MAIN is a content namespace per DefaultSettings.php
/**
* Similar to testIsContent() but alters the $wgContentNamespaces
* global variable.
+ * @covers MWNamespace::isContent
*/
public function testIsContentAdvanced() {
global $wgContentNamespaces;
$this->assertIsContent( NS_MAIN );
}
+ /**
+ * @covers MWNamespace::isWatchable
+ */
public function testIsWatchable() {
// Specials namespaces are not watchable
$this->assertIsNotWatchable( NS_MEDIA );
$this->assertIsWatchable( 101 );
}
+ /**
+ * @covers MWNamespace::hasSubpages
+ */
public function testHasSubpages() {
global $wgNamespacesWithSubpages;
}
/**
+ * @covers MWNamespace::getContentNamespaces
*/
public function testGetContentNamespaces() {
global $wgContentNamespaces;
}
/**
+ * @covers MWNamespace::getSubjectNamespaces
*/
public function testGetSubjectNamespaces() {
$subjectsNS = MWNamespace::getSubjectNamespaces();
}
/**
+ * @covers MWNamespace::getTalkNamespaces
*/
public function testGetTalkNamespaces() {
$talkNS = MWNamespace::getTalkNamespaces();
/**
* Some namespaces are always capitalized per code definition
* in MWNamespace::$alwaysCapitalizedNamespaces
+ * @covers MWNamespace::isCapitalized
*/
public function testIsCapitalizedHardcodedAssertions() {
// NS_MEDIA and NS_FILE are treated the same
*
* Global setting correctness is tested against the NS_PROJECT and
* NS_PROJECT_TALK namespaces since they are not hardcoded nor specials
+ * @covers MWNamespace::isCapitalized
*/
public function testIsCapitalizedWithWgCapitalLinks() {
global $wgCapitalLinks;
* testing the $wgCapitalLinkOverrides global.
*
* @todo split groups of assertions in autonomous testing functions
+ * @covers MWNamespace::isCapitalized
*/
public function testIsCapitalizedWithWgCapitalLinkOverrides() {
global $wgCapitalLinkOverrides;
$this->assertIsCapitalized( NS_PROJECT );
}
+ /**
+ * @covers MWNamespace::hasGenderDistinction
+ */
public function testHasGenderDistinction() {
// Namespaces with gender distinctions
$this->assertTrue( MWNamespace::hasGenderDistinction( NS_USER ) );
$this->assertFalse( MWNamespace::hasGenderDistinction( NS_TALK ) );
}
+ /**
+ * @covers MWNamespace::isNonincludable
+ */
public function testIsNonincludable() {
global $wgNonincludableNamespaces;
) );
}
- function testExists() {
+ /**
+ * @covers Message::exists
+ */
+ public function testExists() {
$this->assertTrue( wfMessage( 'mainpage' )->exists() );
$this->assertTrue( wfMessage( 'mainpage' )->params( array() )->exists() );
$this->assertTrue( wfMessage( 'mainpage' )->rawParams( 'foo', 123 )->exists() );
$this->assertFalse( wfMessage( 'i-dont-exist-evar' )->rawParams( 'foo', 123 )->exists() );
}
- function testKey() {
+ /**
+ * @covers Message::__construct
+ */
+ public function testKey() {
$this->assertInstanceOf( 'Message', wfMessage( 'mainpage' ) );
$this->assertInstanceOf( 'Message', wfMessage( 'i-dont-exist-evar' ) );
$this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->text() );
$this->assertEquals( '<i-dont-exist-evar>', wfMessage( 'i-dont-exist-evar' )->escaped() );
}
- function testInLanguage() {
+ /**
+ * @covers Message::inLanguage
+ */
+ public function testInLanguage() {
$this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inLanguage( 'en' )->text() );
$this->assertEquals( 'Заглавная страница', wfMessage( 'mainpage' )->inLanguage( 'ru' )->text() );
$this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inLanguage( Language::factory( 'en' ) )->text() );
$this->assertEquals( 'Заглавная страница', wfMessage( 'mainpage' )->inLanguage( Language::factory( 'ru' ) )->text() );
}
- function testMessageParams() {
+ /**
+ * @covers Message::__construct
+ */
+ public function testMessageParams() {
$this->assertEquals( 'Return to $1.', wfMessage( 'returnto' )->text() );
$this->assertEquals( 'Return to $1.', wfMessage( 'returnto', array() )->text() );
$this->assertEquals( 'You have foo (bar).', wfMessage( 'youhavenewmessages', 'foo', 'bar' )->text() );
$this->assertEquals( 'You have foo (bar).', wfMessage( 'youhavenewmessages', array( 'foo', 'bar' ) )->text() );
}
- function testMessageParamSubstitution() {
+ /**
+ * @covers Message::__construct
+ * @covers Message::rawParams
+ */
+ public function testMessageParamSubstitution() {
$this->assertEquals( '(Заглавная страница)', wfMessage( 'parentheses', 'Заглавная страница' )->plain() );
$this->assertEquals( '(Заглавная страница $1)', wfMessage( 'parentheses', 'Заглавная страница $1' )->plain() );
$this->assertEquals( '(Заглавная страница)', wfMessage( 'parentheses' )->rawParams( 'Заглавная страница' )->plain() );
$this->assertEquals( '(Заглавная страница $1)', wfMessage( 'parentheses' )->rawParams( 'Заглавная страница $1' )->plain() );
}
- function testDeliciouslyManyParams() {
+ /**
+ * @covers Message::__construct
+ * @covers Message::params
+ */
+ public function testDeliciouslyManyParams() {
$msg = new RawMessage( '$1$2$3$4$5$6$7$8$9$10$11$12' );
// One less than above has placeholders
$params = array( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k' );
/**
* FIXME: This should not need database, but Language#formatExpiry does (bug 55912)
* @group Database
+ * @todo this should be split up into multiple test methods
+ * @covers Message::numParams
+ * @covers Message::durationParams
+ * @covers Message::expiryParams
+ * @covers Message::timeperiodParams
+ * @covers Message::sizeParams
+ * @covers Message::bitrateParams
*/
- function testMessageParamTypes() {
+ public function testMessageParamTypes() {
$lang = Language::factory( 'en' );
$msg = new RawMessage( '$1' );
);
}
- function testInContentLanguageDisabled() {
+ /**
+ * @covers Message::inContentLanguage
+ */
+ public function testInContentLanguageDisabled() {
$this->setMwGlobals( 'wgLang', Language::factory( 'fr' ) );
$this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inContentLanguage()->plain(), 'ForceUIMsg disabled' );
}
- function testInContentLanguageEnabled() {
+ /**
+ * @covers Message::inContentLanguage
+ */
+ public function testInContentLanguageEnabled() {
$this->setMwGlobals( array(
'wgLang' => Language::factory( 'fr' ),
'wgForceUIMsgAsContentMsg' => array( 'mainpage' ),
/**
* @expectedException MWException
+ * @covers Message::inLanguage
*/
- function testInLanguageThrows() {
+ public function testInLanguageThrows() {
wfMessage( 'foo' )->inLanguage( 123 );
}
}
*
* @group Output
*
+ * @todo factor tests in this class into providers and test methods
+ *
*/
class OutputPageTest extends MediaWikiTestCase {
const SCREEN_MEDIA_QUERY = 'screen and (min-width: 982px)';
/**
* Tests print requests
+ * @covers OutputPage::transformCssMedia
*/
public function testPrintRequests() {
$this->assertTransformCssMediaCase( array(
/**
* Tests screen requests, without either query parameter set
+ * @covers OutputPage::transformCssMedia
*/
public function testScreenRequests() {
$this->assertTransformCssMediaCase( array(
/**
* Tests handheld behavior
+ * @covers OutputPage::transformCssMedia
*/
public function testHandheld() {
$this->assertTransformCssMediaCase( array(
<?php
+
/**
* Tests for the PathRouter parsing.
*
- * @todo Add covers tags.
+ * @covers PathRouter
*/
-
class PathRouterTest extends MediaWikiTestCase {
/**
* "Agile Documentation" at
* http://www.phpunit.de/manual/3.4/en/other-uses-for-tests.html
*/
- function testTitleObjectStringConversion() {
+ public function testTitleObjectStringConversion() {
$title = Title::newFromText( "text" );
$this->assertInstanceOf( 'Title', $title, "Title creation" );
$this->assertEquals( "Text", $title, "Automatic string conversion" );
* @expectedException MWException object
* See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.expectedException
*/
- function testTitleObjectFromObject() {
+ public function testTitleObjectFromObject() {
$title = Title::newFromText( Title::newFromText( "test" ) );
$this->assertEquals( "Test", $title->isLocal() );
}
--- /dev/null
+<?php
+
+/**
+ * @author Adam Shorland
+ */
+class StatusTest extends MediaWikiTestCase {
+
+ public function testCanConstruct(){
+ new Status();
+ $this->assertTrue( true );
+ }
+
+ /**
+ * @dataProvider provideValues
+ * @covers Status::newGood
+ * @covers Status::getValue
+ * @covers Status::isGood
+ * @covers Status::isOK
+ */
+ public function testNewGood( $value = null ){
+ $status = Status::newGood( $value );
+ $this->assertTrue( $status->isGood() );
+ $this->assertTrue( $status->isOK() );
+ $this->assertEquals( $value, $status->getValue() );
+ }
+
+ public static function provideValues(){
+ return array(
+ array(),
+ array( 'foo' ),
+ array( array( 'foo' => 'bar' ) ),
+ array( new Exception() ),
+ array( 1234 ),
+ );
+ }
+
+ /**
+ * @covers Status::newFatal
+ * @covers Status::isGood
+ * @covers Status::isOK
+ * @covers Status::getMessage
+ */
+ public function testNewFatalWithMessage() {
+ $message = $this->getMockBuilder( 'Message' )
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $status = Status::newFatal( $message );
+ $this->assertFalse( $status->isGood() );
+ $this->assertFalse( $status->isOK() );
+ $this->assertEquals( $message, $status->getMessage() );
+ }
+
+ /**
+ * @covers Status::newFatal
+ * @covers Status::isGood
+ * @covers Status::isOK
+ * @covers Status::getMessage
+ */
+ public function testNewFatalWithString() {
+ $message = 'foo';
+ $status = Status::newFatal( $message );
+ $this->assertFalse( $status->isGood() );
+ $this->assertFalse( $status->isOK() );
+ $newMessage = $status->getMessage();
+ $this->assertEquals( $message, $newMessage->getKey() );
+ }
+
+ /**
+ * @dataProvider provideSetResult
+ * @covers Status::getValue
+ * @covers Status::isOK
+ */
+ public function testSetResult( $ok, $value = null ) {
+ $status = new Status();
+ $status->setResult( $ok, $value );
+ $this->assertEquals( $ok, $status->isOK() );
+ $this->assertEquals( $value, $status->getValue() );
+ }
+
+ public static function provideSetResult() {
+ return array(
+ array( true ),
+ array( false ),
+ array( true, 'value' ),
+ array( false, 'value' ),
+ );
+ }
+
+ /**
+ * @dataProvider provideMockMessageDetails
+ * @covers Status::warning
+ * @covers Status::getWarningsArray
+ */
+ public function testWarningWithMessage( $mockDetails ) {
+ $status = new Status();
+ $messages = $this->getMockMessages( $mockDetails );
+
+ foreach( $messages as $message ){
+ $status->warning( $message );
+ }
+ $warnings = $status->getWarningsArray();
+
+ $this->assertEquals( count( $messages ), count( $warnings ) );
+ foreach( $messages as $key => $message ) {
+ $expectedArray = array_merge( array( $message->getKey() ), $message->getParams() );
+ $this->assertEquals( $warnings[$key], $expectedArray );
+ }
+ }
+
+ /**
+ * @dataProvider provideMockMessageDetails
+ * @covers Status::error
+ * @covers Status::getErrorsArray
+ */
+ public function testErrorWithMessage( $mockDetails ) {
+ $status = new Status();
+ $messages = $this->getMockMessages( $mockDetails );
+
+ foreach( $messages as $message ){
+ $status->error( $message );
+ }
+ $errors = $status->getErrorsArray();
+
+ $this->assertEquals( count( $messages ), count( $errors ) );
+ foreach( $messages as $key => $message ) {
+ $expectedArray = array_merge( array( $message->getKey() ), $message->getParams() );
+ $this->assertEquals( $errors[$key], $expectedArray );
+ }
+ }
+
+ protected function getMockMessage( $key = 'key', $params = array() ) {
+ $message = $this->getMockBuilder( 'Message' )
+ ->disableOriginalConstructor()
+ ->getMock();
+ $message->expects( $this->atLeastOnce() )
+ ->method( 'getKey' )
+ ->will( $this->returnValue( $key ) );
+ $message->expects( $this->atLeastOnce() )
+ ->method( 'getParams' )
+ ->will( $this->returnValue( $params ) );
+ return $message;
+ }
+
+ /**
+ * @param array $messageDetails eg. array( 'KEY' => array(/PARAMS/) )
+ * @return Message[]
+ */
+ protected function getMockMessages( $messageDetails ){
+ $messages = array();
+ foreach( $messageDetails as $key => $paramsArray ){
+ $messages[] = $this->getMockMessage( $key, $paramsArray );
+ }
+ return $messages;
+ }
+
+ public static function provideMockMessageDetails(){
+ return array(
+ array( array( 'key1' => array( 'foo' => 'bar' ) ) ),
+ array( array( 'key1' => array( 'foo' => 'bar' ), 'key2' => array( 'foo2' => 'bar2' ) ) ),
+ );
+ }
+
+ /**
+ * @covers Status::merge
+ * @todo test merge with $overwriteValue true
+ */
+ public function testMerge(){
+ $status1 = new Status();
+ $status2 = new Status();
+ $message1 = $this->getMockMessage( 'warn1' );
+ $message2 = $this->getMockMessage( 'error2' );
+ $status1->warning( $message1 );
+ $status2->error( $message2 );
+
+ $status1->merge( $status2 );
+ $this->assertEquals( 2, count( $status1->getWarningsArray() ) + count( $status1->getErrorsArray() ) );
+ }
+
+ //todo test cleanParams
+ //todo test getWikiText
+ //todo test getMessage
+ //todo test getErrorMessage
+ //todo test getHTML
+ //todo test getErrorMessageArray
+ //todo test getStatusArray
+ //todo test getErrorsByType
+ //todo test hasMessage
+ //todo test replaceMessage
+ //todo test replaceMessage
+
+}
* @covers StringUtils::isUtf8
* @dataProvider provideStringsForIsUtf8Check
*/
- function testIsUtf8WithMbstring( $expected, $string ) {
+ public function testIsUtf8WithMbstring( $expected, $string ) {
if ( !function_exists( 'mb_check_encoding' ) ) {
$this->markTestSkipped( 'Test requires the mbstring PHP extension' );
}
* @covers StringUtils::isUtf8
* @dataProvider provideStringsForIsUtf8Check
*/
- function testIsUtf8WithPhpFallbackImplementation( $expected, $string ) {
+ public function testIsUtf8WithPhpFallbackImplementation( $expected, $string ) {
$this->assertEquals( $expected,
StringUtils::isUtf8( $string, /** disable mbstring: */true ),
'Testing string "' . $this->escaped( $string ) . '" with pure PHP implementation'
/**
* @covers Title::getParentCategories
*/
- function testTemplateCategories() {
+ public function testTemplateCategories() {
$title = Title::newFromText( "Categorized from template" );
$page = WikiPage::factory( $title );
$user = new User();
/**
* @group Database
- * @todo covers tags
+ *
+ * @covers Title::getUserPermissionsErrors
+ * @covers Title::getUserPermissionsErrorsInternal
*/
class TitlePermissionTest extends MediaWikiLangTestCase {
--- /dev/null
+<?php
+
+class UserMailerTest extends MediaWikiLangTestCase {
+
+ /**
+ * @covers UserMailer::quotedPrintable
+ */
+ public function testQuotedPrintable() {
+ $this->assertEquals(
+ "=?UTF-8?Q?=C4=88u=20legebla=3F?=",
+ UserMailer::quotedPrintable( "\xc4\x88u legebla?", "UTF-8" ) );
+ }
+
+}
\ No newline at end of file
* @dataProvider provideDetectServer
* @covers WebRequest::detectServer
*/
- function testDetectServer( $expected, $input, $description ) {
+ public function testDetectServer( $expected, $input, $description ) {
$_SERVER = $input;
$result = WebRequest::detectServer();
$this->assertEquals( $expected, $result, $description );
* @dataProvider provideGetIP
* @covers WebRequest::getIP
*/
- function testGetIP( $expected, $input, $squid, $xffList, $private, $description ) {
+ public function testGetIP( $expected, $input, $squid, $xffList, $private, $description ) {
$_SERVER = $input;
$this->setMwGlobals( array(
'wgSquidServersNoPurge' => $squid,
* @expectedException MWException
* @covers WebRequest::getIP
*/
- function testGetIpLackOfRemoteAddrThrowAnException() {
+ public function testGetIpLackOfRemoteAddrThrowAnException() {
$request = new WebRequest();
# Next call throw an exception about lacking an IP
$request->getIP();
* @dataProvider provideLanguageData
* @covers WebRequest::getAcceptLang
*/
- function testAcceptLang( $acceptLanguageHeader, $expectedLanguages, $description ) {
+ public function testAcceptLang( $acceptLanguageHeader, $expectedLanguages, $description ) {
$_SERVER = array( 'HTTP_ACCEPT_LANGUAGE' => $acceptLanguageHeader );
$request = new WebRequest();
$this->assertSame( $request->getAcceptLang(), $expectedLanguages, $description );
$this->assertEquals( $expected, $text );
}
+
+ /**
+ * @covers WikiPage::factory
+ */
+ public function testWikiPageFactory() {
+ $title = Title::makeTitle( NS_FILE, 'Someimage.png' );
+ $page = WikiPage::factory( $title );
+ $this->assertEquals( 'WikiFilePage', get_class( $page ) );
+
+ $title = Title::makeTitle( NS_CATEGORY, 'SomeCategory' );
+ $page = WikiPage::factory( $title );
+ $this->assertEquals( 'WikiCategoryPage', get_class( $page ) );
+
+ $title = Title::makeTitle( NS_MAIN, 'SomePage' );
+ $page = WikiPage::factory( $title );
+ $this->assertEquals( 'WikiPage', get_class( $page ) );
+ }
}
/**
* @covers Xml::element
*/
- function testElementOpen() {
+ public function testElementOpen() {
$this->assertEquals(
'<element>',
Xml::element( 'element', null, null ),
/**
* @covers Xml::element
*/
- function testElementEmpty() {
+ public function testElementEmpty() {
$this->assertEquals(
'<element />',
Xml::element( 'element', null, '' ),
/**
* @covers Xml::input
*/
- function testElementInputCanHaveAValueOfZero() {
+ public function testElementInputCanHaveAValueOfZero() {
$this->assertEquals(
'<input name="name" value="0" />',
Xml::input( 'name', false, 0 ),
/**
* @covers Xml::element
*/
- function testElementEscaping() {
+ public function testElementEscaping() {
$this->assertEquals(
'<element>hello <there> you & you</element>',
Xml::element( 'element', null, 'hello <there> you & you' ),
/**
* @covers Xml::element
*/
- function testElementAttributes() {
+ public function testElementAttributes() {
$this->assertEquals(
'<element key="value" <>="<>">',
Xml::element( 'element', array( 'key' => 'value', '<>' => '<>' ), null ),
/**
* @covers Xml::openElement
*/
- function testOpenElement() {
+ public function testOpenElement() {
$this->assertEquals(
'<element k="v">',
Xml::openElement( 'element', array( 'k' => 'v' ) ),
/**
* @covers Xml::closeElement
*/
- function testCloseElement() {
+ public function testCloseElement() {
$this->assertEquals( '</element>', Xml::closeElement( 'element' ), 'closeElement() shortcut' );
}
/**
* @covers Xml::textarea
*/
- function testTextareaNoContent() {
+ public function testTextareaNoContent() {
$this->assertEquals(
'<textarea name="name" id="name" cols="40" rows="5"></textarea>',
Xml::textarea( 'name', '' ),
/**
* @covers Xml::textarea
*/
- function testTextareaAttribs() {
+ public function testTextareaAttribs() {
$this->assertEquals(
'<textarea name="name" id="name" cols="20" rows="10"><txt></textarea>',
Xml::textarea( 'name', '<txt>', 20, 10 ),
/**
* @covers Xml::label
*/
- function testLabelCreation() {
+ public function testLabelCreation() {
$this->assertEquals(
'<label for="id">name</label>',
Xml::label( 'name', 'id' ),
/**
* @covers Xml::label
*/
- function testLabelAttributeCanOnlyBeClassOrTitle() {
+ public function testLabelAttributeCanOnlyBeClassOrTitle() {
$this->assertEquals(
'<label for="id">name</label>',
Xml::label( 'name', 'id', array( 'generated' => true ) ),
/**
* @covers Xml::languageSelector
*/
- function testLanguageSelector() {
+ public function testLanguageSelector() {
$select = Xml::languageSelector( 'en', true, null,
array( 'id' => 'testlang' ), wfMessage( 'yourlanguage' ) );
$this->assertEquals(
/**
* @covers Xml::escapeJsString
*/
- function testEscapeJsStringSpecialChars() {
+ public function testEscapeJsStringSpecialChars() {
$this->assertEquals(
'\\\\\r\n',
Xml::escapeJsString( "\\\r\n" ),
/**
* @covers Xml::encodeJsVar
*/
- function testEncodeJsVarBoolean() {
+ public function testEncodeJsVarBoolean() {
$this->assertEquals(
'true',
Xml::encodeJsVar( true ),
/**
* @covers Xml::encodeJsVar
*/
- function testEncodeJsVarNull() {
+ public function testEncodeJsVarNull() {
$this->assertEquals(
'null',
Xml::encodeJsVar( null ),
/**
* @covers Xml::encodeJsVar
*/
- function testEncodeJsVarArray() {
+ public function testEncodeJsVarArray() {
$this->assertEquals(
'["a",1]',
Xml::encodeJsVar( array( 'a', 1 ) ),
/**
* @covers Xml::encodeJsVar
*/
- function testEncodeJsVarObject() {
+ public function testEncodeJsVarObject() {
$this->assertEquals(
'{"a":"a","b":1}',
Xml::encodeJsVar( (object)array( 'a' => 'a', 'b' => 1 ) ),
/**
* @covers Xml::encodeJsVar
*/
- function testEncodeJsVarInt() {
+ public function testEncodeJsVarInt() {
$this->assertEquals(
'123456',
Xml::encodeJsVar( 123456 ),
/**
* @covers Xml::encodeJsVar
*/
- function testEncodeJsVarFloat() {
+ public function testEncodeJsVarFloat() {
$this->assertEquals(
'1.23456',
Xml::encodeJsVar( 1.23456 ),
/**
* @covers Xml::encodeJsVar
*/
- function testEncodeJsVarIntString() {
+ public function testEncodeJsVarIntString() {
$this->assertEquals(
'"123456"',
Xml::encodeJsVar( '123456' ),
/**
* @covers Xml::encodeJsVar
*/
- function testEncodeJsVarFloatString() {
+ public function testEncodeJsVarFloatString() {
$this->assertEquals(
'"1.23456"',
Xml::encodeJsVar( '1.23456' ),
$this->assertTrue( $status->isOK(), $assertMessage );
}
- function testEmpty() {
+ public function testEmpty() {
$this->readZipAssertSuccess( 'empty.zip', 'Empty zip' );
}
- function testMultiDisk0() {
+ public function testMultiDisk0() {
$this->readZipAssertError( 'split.zip', 'zip-unsupported',
'Split zip error' );
}
- function testNoSignature() {
+ public function testNoSignature() {
$this->readZipAssertError( 'nosig.zip', 'zip-wrong-format',
'No signature should give "wrong format" error' );
}
- function testSimple() {
+ public function testSimple() {
$this->readZipAssertSuccess( 'class.zip', 'Simple ZIP' );
$this->assertEquals( $this->entries, array( array(
'name' => 'Class.class',
) ) );
}
- function testBadCentralEntrySignature() {
+ public function testBadCentralEntrySignature() {
$this->readZipAssertError( 'wrong-central-entry-sig.zip', 'zip-bad',
'Bad central entry error' );
}
- function testTrailingBytes() {
+ public function testTrailingBytes() {
$this->readZipAssertError( 'trail.zip', 'zip-bad',
'Trailing bytes error' );
}
- function testWrongCDStart() {
+ public function testWrongCDStart() {
$this->readZipAssertError( 'wrong-cd-start-disk.zip', 'zip-unsupported',
'Wrong CD start disk error' );
}
- function testCentralDirectoryGap() {
+ public function testCentralDirectoryGap() {
$this->readZipAssertError( 'cd-gap.zip', 'zip-bad',
'CD gap error' );
}
- function testCentralDirectoryTruncated() {
+ public function testCentralDirectoryTruncated() {
$this->readZipAssertError( 'cd-truncated.zip', 'zip-bad',
'CD truncated error (should hit unpack() overrun)' );
}
- function testLooksLikeZip64() {
+ public function testLooksLikeZip64() {
$this->readZipAssertError( 'looks-like-zip64.zip', 'zip-unsupported',
'A file which looks like ZIP64 but isn\'t, should give error' );
}
+++ /dev/null
-<?php
-
-/**
- * @group Database
- * @group API
- * @group medium
- */
-class ApiCreateAccountTest extends ApiTestCase {
- function setUp() {
- parent::setUp();
- LoginForm::setCreateaccountToken();
- $this->setMwGlobals( array( 'wgEnableEmail' => true ) );
- }
-
- /**
- * Test the account creation API with a valid request. Also
- * make sure the new account can log in and is valid.
- *
- * This test does multiple API requests so it might end up being
- * a bit slow. Raise the default timeout.
- * @group medium
- */
- function testValid() {
- global $wgServer;
-
- if ( !isset( $wgServer ) ) {
- $this->markTestIncomplete( 'This test needs $wgServer to be set in LocalSettings.php' );
- }
-
- $password = User::randomPassword();
-
- $ret = $this->doApiRequest( array(
- 'action' => 'createaccount',
- 'name' => 'Apitestnew',
- 'password' => $password,
- 'email' => 'test@domain.test',
- 'realname' => 'Test Name'
- ) );
-
- $result = $ret[0];
- $this->assertNotInternalType( 'bool', $result );
- $this->assertNotInternalType( 'null', $result['createaccount'] );
-
- // Should first ask for token.
- $a = $result['createaccount'];
- $this->assertEquals( 'needtoken', $a['result'] );
- $token = $a['token'];
-
- // Finally create the account
- $ret = $this->doApiRequest(
- array(
- 'action' => 'createaccount',
- 'name' => 'Apitestnew',
- 'password' => $password,
- 'token' => $token,
- 'email' => 'test@domain.test',
- 'realname' => 'Test Name'
- ),
- $ret[2]
- );
-
- $result = $ret[0];
- $this->assertNotInternalType( 'bool', $result );
- $this->assertEquals( 'success', $result['createaccount']['result'] );
-
- // Try logging in with the new user.
- $ret = $this->doApiRequest( array(
- 'action' => 'login',
- 'lgname' => 'Apitestnew',
- 'lgpassword' => $password,
- ) );
-
- $result = $ret[0];
- $this->assertNotInternalType( 'bool', $result );
- $this->assertNotInternalType( 'null', $result['login'] );
-
- $a = $result['login']['result'];
- $this->assertEquals( 'NeedToken', $a );
- $token = $result['login']['token'];
-
- $ret = $this->doApiRequest(
- array(
- 'action' => 'login',
- 'lgtoken' => $token,
- 'lgname' => 'Apitestnew',
- 'lgpassword' => $password,
- ),
- $ret[2]
- );
-
- $result = $ret[0];
-
- $this->assertNotInternalType( 'bool', $result );
- $a = $result['login']['result'];
-
- $this->assertEquals( 'Success', $a );
-
- // log out to destroy the session
- $ret = $this->doApiRequest(
- array(
- 'action' => 'logout',
- ),
- $ret[2]
- );
- $this->assertEquals( array(), $ret[0] );
- }
-
- /**
- * Make sure requests with no names are invalid.
- * @expectedException UsageException
- */
- function testNoName() {
- $this->doApiRequest( array(
- 'action' => 'createaccount',
- 'token' => LoginForm::getCreateaccountToken(),
- 'password' => 'password',
- ) );
- }
-
- /**
- * Make sure requests with no password are invalid.
- * @expectedException UsageException
- */
- function testNoPassword() {
- $this->doApiRequest( array(
- 'action' => 'createaccount',
- 'name' => 'testName',
- 'token' => LoginForm::getCreateaccountToken(),
- ) );
- }
-
- /**
- * Make sure requests with existing users are invalid.
- * @expectedException UsageException
- */
- function testExistingUser() {
- $this->doApiRequest( array(
- 'action' => 'createaccount',
- 'name' => 'Apitestsysop',
- 'token' => LoginForm::getCreateaccountToken(),
- 'password' => 'password',
- 'email' => 'test@domain.test',
- ) );
- }
-
- /**
- * Make sure requests with invalid emails are invalid.
- * @expectedException UsageException
- */
- function testInvalidEmail() {
- $this->doApiRequest( array(
- 'action' => 'createaccount',
- 'name' => 'Test User',
- 'token' => LoginForm::getCreateaccountToken(),
- 'password' => 'password',
- 'email' => 'invalid',
- ) );
- }
-}
* @group API
* @group Database
* @group medium
+ *
+ * @covers ApiBlock
*/
class ApiBlockTest extends ApiTestCase {
protected function setUp() {
$this->doLogin();
}
- function getTokens() {
+ protected function getTokens() {
return $this->getTokenList( self::$users['sysop'] );
}
* Which made the Block/Unblock API to actually verify the token
* previously always considered valid (bug 34212).
*/
- function testMakeNormalBlock() {
+ public function testMakeNormalBlock() {
$tokens = $this->getTokens();
$user = User::newFromName( 'UTApiBlockee' );
}
/**
- * Attempting to block without a token should give a UsageException with
- * error message:
- * "The token parameter must be set"
- *
- * @dataProvider provideBlockUnblockAction
* @expectedException UsageException
+ * @expectedExceptionMessage The token parameter must be set
*/
- function testBlockingActionWithNoToken( $action ) {
+ public function testBlockingActionWithNoToken( ) {
$this->doApiRequest(
array(
- 'action' => $action,
+ 'action' => 'block',
'user' => 'UTApiBlockee',
'reason' => 'Some reason',
),
self::$users['sysop']->user
);
}
-
- /**
- * Just provide the 'block' and 'unblock' action to test both API calls
- */
- public static function provideBlockUnblockAction() {
- return array(
- array( 'block' ),
- array( 'unblock' ),
- );
- }
}
--- /dev/null
+<?php
+
+/**
+ * @group Database
+ * @group API
+ * @group medium
+ *
+ * @covers ApiCreateAccount
+ */
+class ApiCreateAccountTest extends ApiTestCase {
+ protected function setUp() {
+ parent::setUp();
+ LoginForm::setCreateaccountToken();
+ $this->setMwGlobals( array( 'wgEnableEmail' => true ) );
+ }
+
+ /**
+ * Test the account creation API with a valid request. Also
+ * make sure the new account can log in and is valid.
+ *
+ * This test does multiple API requests so it might end up being
+ * a bit slow. Raise the default timeout.
+ * @group medium
+ */
+ public function testValid() {
+ global $wgServer;
+
+ if ( !isset( $wgServer ) ) {
+ $this->markTestIncomplete( 'This test needs $wgServer to be set in LocalSettings.php' );
+ }
+
+ $password = User::randomPassword();
+
+ $ret = $this->doApiRequest( array(
+ 'action' => 'createaccount',
+ 'name' => 'Apitestnew',
+ 'password' => $password,
+ 'email' => 'test@domain.test',
+ 'realname' => 'Test Name'
+ ) );
+
+ $result = $ret[0];
+ $this->assertNotInternalType( 'bool', $result );
+ $this->assertNotInternalType( 'null', $result['createaccount'] );
+
+ // Should first ask for token.
+ $a = $result['createaccount'];
+ $this->assertEquals( 'needtoken', $a['result'] );
+ $token = $a['token'];
+
+ // Finally create the account
+ $ret = $this->doApiRequest(
+ array(
+ 'action' => 'createaccount',
+ 'name' => 'Apitestnew',
+ 'password' => $password,
+ 'token' => $token,
+ 'email' => 'test@domain.test',
+ 'realname' => 'Test Name'
+ ),
+ $ret[2]
+ );
+
+ $result = $ret[0];
+ $this->assertNotInternalType( 'bool', $result );
+ $this->assertEquals( 'success', $result['createaccount']['result'] );
+
+ // Try logging in with the new user.
+ $ret = $this->doApiRequest( array(
+ 'action' => 'login',
+ 'lgname' => 'Apitestnew',
+ 'lgpassword' => $password,
+ ) );
+
+ $result = $ret[0];
+ $this->assertNotInternalType( 'bool', $result );
+ $this->assertNotInternalType( 'null', $result['login'] );
+
+ $a = $result['login']['result'];
+ $this->assertEquals( 'NeedToken', $a );
+ $token = $result['login']['token'];
+
+ $ret = $this->doApiRequest(
+ array(
+ 'action' => 'login',
+ 'lgtoken' => $token,
+ 'lgname' => 'Apitestnew',
+ 'lgpassword' => $password,
+ ),
+ $ret[2]
+ );
+
+ $result = $ret[0];
+
+ $this->assertNotInternalType( 'bool', $result );
+ $a = $result['login']['result'];
+
+ $this->assertEquals( 'Success', $a );
+
+ // log out to destroy the session
+ $ret = $this->doApiRequest(
+ array(
+ 'action' => 'logout',
+ ),
+ $ret[2]
+ );
+ $this->assertEquals( array(), $ret[0] );
+ }
+
+ /**
+ * Make sure requests with no names are invalid.
+ * @expectedException UsageException
+ */
+ public function testNoName() {
+ $this->doApiRequest( array(
+ 'action' => 'createaccount',
+ 'token' => LoginForm::getCreateaccountToken(),
+ 'password' => 'password',
+ ) );
+ }
+
+ /**
+ * Make sure requests with no password are invalid.
+ * @expectedException UsageException
+ */
+ public function testNoPassword() {
+ $this->doApiRequest( array(
+ 'action' => 'createaccount',
+ 'name' => 'testName',
+ 'token' => LoginForm::getCreateaccountToken(),
+ ) );
+ }
+
+ /**
+ * Make sure requests with existing users are invalid.
+ * @expectedException UsageException
+ */
+ public function testExistingUser() {
+ $this->doApiRequest( array(
+ 'action' => 'createaccount',
+ 'name' => 'Apitestsysop',
+ 'token' => LoginForm::getCreateaccountToken(),
+ 'password' => 'password',
+ 'email' => 'test@domain.test',
+ ) );
+ }
+
+ /**
+ * Make sure requests with invalid emails are invalid.
+ * @expectedException UsageException
+ */
+ public function testInvalidEmail() {
+ $this->doApiRequest( array(
+ 'action' => 'createaccount',
+ 'name' => 'Test User',
+ 'token' => LoginForm::getCreateaccountToken(),
+ 'password' => 'password',
+ 'email' => 'invalid',
+ ) );
+ }
+}
* @group API
* @group Database
* @group medium
+ *
+ * @covers ApiEditPage
*/
class ApiEditPageTest extends ApiTestCase {
parent::tearDown();
}
- function testEdit() {
+ public function testEdit() {
$name = 'Help:ApiEditPageTest_testEdit'; // assume Help namespace to default to wikitext
// -- test new page --------------------------------------------
);
}
- function testNonTextEdit() {
+ public function testNonTextEdit() {
$name = 'Dummy:ApiEditPageTest_testNonTextEdit';
$data = serialize( 'some bla bla text' );
/**
* @dataProvider provideEditAppend
*/
- function testEditAppend( $text, $op, $append, $expected ) {
+ public function testEditAppend( $text, $op, $append, $expected ) {
static $count = 0;
$count++;
/**
* Test editing of sections
*/
- function testEditSection() {
+ public function testEditSection() {
$name = 'Help:ApiEditPageTest_testEditSection';
$page = WikiPage::factory( Title::newFromText( $name ) );
$text = "==section 1==\ncontent 1\n==section 2==\ncontent2";
* page that doesn't exist (bug 52830) and one that
* does exist
*/
- function testEditNewSection() {
+ public function testEditNewSection() {
$name = 'Help:ApiEditPageTest_testEditNewSection';
// Test on a page that does not already exist
$this->assertEquals( $text, "== header ==\n\ntest\n\n== header ==\n\ntest" );
}
- function testEditConflict() {
+ public function testEditConflict() {
static $count = 0;
$count++;
}
}
- function testEditConflict_redirect() {
+ public function testEditConflict_redirect() {
static $count = 0;
$count++;
}
}
- function testEditConflict_bug41990() {
+ public function testEditConflict_bug41990() {
static $count = 0;
$count++;
* @group API
* @group Database
* @group medium
+ *
+ * @covers ApiOptions
*/
class ApiOptionsTest extends MediaWikiLangTestCase {
- private $mTested, $mUserMock, $mContext, $mSession;
+ /** @var PHPUnit_Framework_MockObject_MockObject */
+ private $mUserMock ;
+ /** @var ApiOptions */
+ private $mTested;
+ private $mSession;
+ /** @var DerivativeContext */
+ private $mContext;
private $mOldGetPreferencesHooks = false;
* @group API
* @group Database
* @group medium
+ *
+ * @covers ApiParse
*/
class ApiParseTest extends ApiTestCase {
$this->doLogin();
}
- function testParseNonexistentPage() {
+ public function testParseNonexistentPage() {
$somePage = mt_rand();
try {
* @group API
* @group Database
* @group medium
+ *
+ * @covers ApiPurge
*/
class ApiPurgeTest extends ApiTestCase {
/**
* @group Broken
*/
- function testPurgeMainPage() {
+ public function testPurgeMainPage() {
if ( !Title::newFromText( 'UTPage' )->exists() ) {
$this->markTestIncomplete( "The article [[UTPage]] does not exist" );
}
*/
class ApiTest extends ApiTestCase {
- function testRequireOnlyOneParameterDefault() {
+ public function testRequireOnlyOneParameterDefault() {
$mock = new MockApi();
$this->assertEquals(
/**
* @expectedException UsageException
*/
- function testRequireOnlyOneParameterZero() {
+ public function testRequireOnlyOneParameterZero() {
$mock = new MockApi();
$this->assertEquals(
/**
* @expectedException UsageException
*/
- function testRequireOnlyOneParameterTrue() {
+ public function testRequireOnlyOneParameterTrue() {
$mock = new MockApi();
$this->assertEquals(
*
* @expectedException UsageException
*/
- function testApi() {
+ public function testApi() {
$api = new ApiMain(
new FauxRequest( array( 'action' => 'help', 'format' => 'xml' ) )
);
/**
* Test result of attempted login with an empty username
*/
- function testApiLoginNoName() {
+ public function testApiLoginNoName() {
$data = $this->doApiRequest( array( 'action' => 'login',
'lgname' => '', 'lgpassword' => self::$users['sysop']->password,
) );
$this->assertEquals( 'NoName', $data[0]['login']['result'] );
}
- function testApiLoginBadPass() {
+ public function testApiLoginBadPass() {
global $wgServer;
$user = self::$users['sysop'];
$this->assertEquals( "WrongPass", $a );
}
- function testApiLoginGoodPass() {
+ public function testApiLoginGoodPass() {
global $wgServer;
if ( !isset( $wgServer ) ) {
/**
* @group Broken
*/
- function testApiGotCookie() {
+ public function testApiGotCookie() {
$this->markTestIncomplete( "The server can't do external HTTP requests, and the internal one won't give cookies" );
global $wgServer, $wgScriptPath;
return $cj;
}
- function testRunLogin() {
+ public function testRunLogin() {
$sysopUser = self::$users['sysop'];
$data = $this->doApiRequest( array(
'action' => 'login',
return $data;
}
- function testGettingToken() {
+ public function testGettingToken() {
foreach ( self::$users as $user ) {
$this->runTokenTest( $user );
}
* @param $params Array: key-value API params
* @param $session Array|null: session array
* @param $user User|null A User object for the context
- * @return result of the API call
+ * @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 ) {
);
}
}
-
-class UserWrapper {
- public $userName;
- public $password;
- public $user;
-
- public function __construct( $userName, $password, $group = '' ) {
- $this->userName = $userName;
- $this->password = $password;
-
- $this->user = User::newFromName( $this->userName );
- if ( !$this->user->getID() ) {
- $this->user = User::createNew( $this->userName, array(
- "email" => "test@example.com",
- "real_name" => "Test User" ) );
- }
- $this->user->setPassword( $this->password );
-
- if ( $group !== '' ) {
- $this->user->addGroup( $group );
- }
- $this->user->saveSettings();
- }
-}
-
-class MockApi extends ApiBase {
- public function execute() {
- }
-
- public function getVersion() {
- }
-
- public function __construct() {
- }
-
- public function getAllowedParams() {
- return array(
- 'filename' => null,
- 'enablechunks' => false,
- 'sessionkey' => null,
- );
- }
-}
-
-class ApiTestContext extends RequestContext {
-
- /**
- * Returns a DerivativeContext with the request variables in place
- *
- * @param $request WebRequest request object including parameters and session
- * @param $user User or null
- * @return DerivativeContext
- */
- public function newTestContext( WebRequest $request, User $user = null ) {
- $context = new DerivativeContext( $this );
- $context->setRequest( $request );
- if ( $user !== null ) {
- $context->setUser( $user );
- }
-
- return $context;
- }
-}
--- /dev/null
+<?php
+
+class ApiTestContext extends RequestContext {
+
+ /**
+ * Returns a DerivativeContext with the request variables in place
+ *
+ * @param $request WebRequest request object including parameters and session
+ * @param $user User or null
+ * @return DerivativeContext
+ */
+ public function newTestContext( WebRequest $request, User $user = null ) {
+ $context = new DerivativeContext( $this );
+ $context->setRequest( $request );
+ if ( $user !== null ) {
+ $context->setUser( $user );
+ }
+
+ return $context;
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * @group API
+ * @group Database
+ * @group medium
+ *
+ * @covers ApiUnblock
+ */
+class ApiUnblockTest extends ApiTestCase {
+ protected function setUp() {
+ parent::setUp();
+ $this->doLogin();
+ }
+
+ /**
+ * @expectedException UsageException
+ */
+ public function testWithNoToken( ) {
+ $this->doApiRequest(
+ array(
+ 'action' => 'unblock',
+ 'user' => 'UTApiBlockee',
+ 'reason' => 'Some reason',
+ ),
+ null,
+ false,
+ self::$users['sysop']->user
+ );
+ }
+}
* Testing login
* XXX this is a funny way of getting session context
*/
- function testLogin() {
+ public function testLogin() {
$user = self::$users['uploader'];
$params = array(
/**
*/
- function testWatchEdit() {
+ public function testWatchEdit() {
$tokens = $this->getTokens();
$data = $this->doApiRequest( array(
/**
* @depends testWatchEdit
*/
- function testWatchClear() {
+ public function testWatchClear() {
$tokens = $this->getTokens();
$data = $this->doApiRequest( array(
/**
*/
- function testWatchProtect() {
+ public function testWatchProtect() {
$tokens = $this->getTokens();
$data = $this->doApiRequest( array(
/**
*/
- function testGetRollbackToken() {
+ public function testGetRollbackToken() {
$this->getTokens();
if ( !Title::newFromText( 'Help:UTPage' )->exists() ) {
*
* @depends testGetRollbackToken
*/
- function testWatchRollback( $data ) {
+ public function testWatchRollback( $data ) {
$keys = array_keys( $data[0]['query']['pages'] );
$key = array_pop( $keys );
$pageinfo = $data[0]['query']['pages'][$key];
--- /dev/null
+<?php
+
+class MockApi extends ApiBase {
+ public function execute() {
+ }
+
+ public function getVersion() {
+ }
+
+ public function __construct() {
+ }
+
+ public function getAllowedParams() {
+ return array(
+ 'filename' => null,
+ 'enablechunks' => false,
+ 'sessionkey' => null,
+ );
+ }
+}
\ No newline at end of file
* @group API
*/
class PrefixUniquenessTest extends MediaWikiTestCase {
+
public function testPrefixes() {
$main = new ApiMain( new FauxRequest() );
$query = new ApiQuery( $main, 'foo', 'bar' );
$prefixes = array();
foreach ( $modules as $name => $class ) {
+ /** @var ApiMain $module */
$module = new $class( $main, $name );
$prefix = $module->getModulePrefix();
if ( isset( $prefixes[$prefix] ) ) {
--- /dev/null
+<?php
+
+class UserWrapper {
+ public $userName;
+ public $password;
+ public $user;
+
+ public function __construct( $userName, $password, $group = '' ) {
+ $this->userName = $userName;
+ $this->password = $password;
+
+ $this->user = User::newFromName( $this->userName );
+ if ( !$this->user->getID() ) {
+ $this->user = User::createNew( $this->userName, array(
+ "email" => "test@example.com",
+ "real_name" => "Test User" ) );
+ }
+ $this->user->setPassword( $this->password );
+
+ if ( $group !== '' ) {
+ $this->user->addGroup( $group );
+ }
+ $this->user->saveSettings();
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * @group API
+ * @group Database
+ * @group medium
+ * @covers ApiFormatJson
+ */
+class ApiFormatJsonTest extends ApiFormatTestBase {
+
+ public function testValidSyntax( ) {
+ $data = $this->apiRequest( 'json', array( 'action' => 'query', 'meta' => 'siteinfo' ) );
+
+ $this->assertInternalType( 'array', json_decode( $data, true ) );
+ $this->assertGreaterThan( 0, count( (array)$data ) );
+ }
+}
* @group API
* @group Database
* @group medium
+ * @covers ApiFormatPhp
*/
class ApiFormatPhpTest extends ApiFormatTestBase {
- function testValidPhpSyntax() {
-
+ public function testValidyntax( ) {
$data = $this->apiRequest( 'php', array( 'action' => 'query', 'meta' => 'siteinfo' ) );
$this->assertInternalType( 'array', unserialize( $data ) );
<?php
abstract class ApiFormatTestBase extends ApiTestCase {
+
+ /**
+ * @param string $format
+ * @param array $params
+ * @param $data
+ *
+ * @return string
+ */
protected function apiRequest( $format, $params, $data = null ) {
$data = parent::doApiRequest( $params, $data, true );
+ /** @var ApiMain $module */
$module = $data[3];
$printer = $module->createPrinterByName( $format );
return $out;
}
+
}
--- /dev/null
+<?php
+
+/**
+ * @group API
+ * @group Database
+ * @group medium
+ * @covers ApiFormatWddx
+ */
+class ApiFormatWddxTest extends ApiFormatTestBase {
+
+ public function testValidSyntax( ) {
+ $data = $this->apiRequest( 'wddx', array( 'action' => 'query', 'meta' => 'siteinfo' ) );
+
+ $this->assertInternalType( 'array', wddx_deserialize( $data ) );
+ $this->assertGreaterThan( 0, count( (array)$data ) );
+ }
+}
require_once 'ApiQueryTestBase.php';
-/** These tests validate basic functionality of the api query module
+/**
+ * These tests validate basic functionality of the api query module
*
* @group API
* @group Database
* @group medium
+ * @covers ApiQuery
*/
class ApiQueryBasicTest extends ApiQueryTestBase {
/**
* @group API
* @group Database
* @group medium
+ * @covers ApiQuery
*/
class ApiQueryContinue2Test extends ApiQueryContinueTestBase {
/**
* @group API
* @group Database
* @group medium
+ * @covers ApiQuery
*/
class ApiQueryContinueTest extends ApiQueryContinueTestBase {
/**
<?php
/**
- *
- *
* Created on Jan 1, 2013
*
* Copyright © 2013 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
* @group API
* @group Database
* @group medium
+ * @covers ApiQueryRevisions
*/
class ApiQueryRevisionsTest extends ApiTestCase {
/**
* @group medium
*/
- function testContentComesWithContentModelAndFormat() {
+ public function testContentComesWithContentModelAndFormat() {
$pageName = 'Help:' . __METHOD__;
$title = Title::newFromText( $pageName );
$page = WikiPage::factory( $title );
* @group API
* @group Database
* @group medium
+ * @covers ApiQuery
*/
class ApiQueryTest extends ApiTestCase {
$this->doLogin();
}
- function testTitlesGetNormalized() {
+ public function testTitlesGetNormalized() {
global $wgMetaNamespace;
);
}
- function testTitlesAreRejectedIfInvalid() {
+ public function testTitlesAreRejectedIfInvalid() {
$title = false;
while ( !$title || Title::newFromText( $title )->exists() ) {
$title = md5( mt_rand( 0, 10000 ) + rand( 0, 999000 ) );
<?php
/**
- *
- *
* Created on Feb 10, 2013
*
* Copyright © 2013 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
* @dataProvider provideUserGenders
* @covers GenderCache::getGenderOf
*/
- function testUserName( $username, $expectedGender ) {
+ public function testUserName( $username, $expectedGender ) {
$genderCache = GenderCache::singleton();
$gender = $genderCache->getGenderOf( $username );
$this->assertEquals( $gender, $expectedGender, "GenderCache normal" );
* @dataProvider provideUserGenders
* @covers GenderCache::getGenderOf
*/
- function testUserObjects( $username, $expectedGender ) {
+ public function testUserObjects( $username, $expectedGender ) {
$genderCache = GenderCache::singleton();
$user = User::newFromName( $username );
$gender = $genderCache->getGenderOf( $user );
* @dataProvider provideStripSubpages
* @covers GenderCache::getGenderOf
*/
- function testStripSubpages( $pageWithSubpage, $expectedGender ) {
+ public function testStripSubpages( $pageWithSubpage, $expectedGender ) {
$genderCache = GenderCache::singleton();
$gender = $genderCache->getGenderOf( $pageWithSubpage );
$this->assertEquals( $gender, $expectedGender, "GenderCache must strip of subpages" );
*
* @dataProvider provideMessagesForFallback
*/
- function testMessageFallbacks( $message, $lang, $expectedContent ) {
+ public function testMessageFallbacks( $message, $lang, $expectedContent ) {
$result = MessageCache::singleton()->get( $message, true, $lang );
$this->assertEquals( $expectedContent, $result, "Message fallback failed." );
}
*
* @dataProvider provideMessagesForFullKeys
*/
- function testFullKeyBehaviour( $message, $lang, $expectedContent ) {
+ public function testFullKeyBehaviour( $message, $lang, $expectedContent ) {
$result = MessageCache::singleton()->get( $message, true, $lang, true );
$this->assertEquals( $expectedContent, $result, "Full key message fallback failed." );
}
/**
* Highlight diff between assertEquals and assertNotSame
*/
- function testPhpUnitArrayEquality() {
+ public function testPhpUnitArrayEquality() {
$one = array( 'A' => 1, 'B' => 2 );
$two = array( 'B' => 2, 'A' => 1 );
$this->assertEquals( $one, $two ); // ==
* @dataProvider provideInvalidConstructorArg
* @expectedException MWException
*/
- function testConstructorGivenInvalidValue( $maxSize ) {
+ public function testConstructorGivenInvalidValue( $maxSize ) {
new ProcessCacheLRUTestable( $maxSize );
}
);
}
- function testAddAndGetAKey() {
+ public function testAddAndGetAKey() {
$oneCache = new ProcessCacheLRUTestable( 1 );
$this->assertCacheEmpty( $oneCache );
$this->assertEquals( 'value1', $oneCache->get( 'cache-key', 'prop1' ) );
}
- function testDeleteOldKey() {
+ public function testDeleteOldKey() {
$oneCache = new ProcessCacheLRUTestable( 1 );
$this->assertCacheEmpty( $oneCache );
* @param $cacheMaxEntries Maximum entry the created cache will hold
* @param $entryToFill Number of entries to insert in the created cache.
*/
- function testFillingCache( $cacheMaxEntries, $entryToFill, $msg = '' ) {
+ public function testFillingCache( $cacheMaxEntries, $entryToFill, $msg = '' ) {
$cache = new ProcessCacheLRUTestable( $cacheMaxEntries );
$this->fillCache( $cache, $entryToFill );
* Create a cache with only one remaining entry then update
* the first inserted entry. Should bump it to the top.
*/
- function testReplaceExistingKeyShouldBumpEntryToTop() {
+ public function testReplaceExistingKeyShouldBumpEntryToTop() {
$maxEntries = 3;
$cache = new ProcessCacheLRUTestable( $maxEntries );
);
}
- function testRecentlyAccessedKeyStickIn() {
+ public function testRecentlyAccessedKeyStickIn() {
$cache = new ProcessCacheLRUTestable( 2 );
$cache->set( 'first', 'prop1', 'value1' );
$cache->set( 'second', 'prop2', 'value2' );
* Given a cache having 1,2,3 as key, updating 2 should bump 2 to
* the top of the queue with the new value: 1,3,2* (* = updated).
*/
- function testReplaceExistingKeyInAFullCacheShouldBumpToTop() {
+ public function testReplaceExistingKeyInAFullCacheShouldBumpToTop() {
$maxEntries = 3;
$cache = new ProcessCacheLRUTestable( $maxEntries );
);
}
- function testBumpExistingKeyToTop() {
+ public function testBumpExistingKeyToTop() {
$cache = new ProcessCacheLRUTestable( 3 );
$this->fillCache( $cache, 3 );
* @dataProvider provideDiapers
* @covers DatabaseMysqlBase::addIdentifierQuotes
*/
- function testAddIdentifierQuotes( $expected, $in ) {
+ public function testAddIdentifierQuotes( $expected, $in ) {
$db = new FakeDatabaseMysqlBase();
$quoted = $db->addIdentifierQuotes( $in );
$this->assertEquals($expected, $quoted);
* @dataProvider provideSelect
* @covers DatabaseBase::select
*/
- function testSelect( $sql, $sqlText ) {
+ public function testSelect( $sql, $sqlText ) {
$this->database->select(
$sql['tables'],
$sql['fields'],
* @dataProvider provideUpdate
* @covers DatabaseBase::update
*/
- function testUpdate( $sql, $sqlText ) {
+ public function testUpdate( $sql, $sqlText ) {
$this->database->update(
$sql['table'],
$sql['values'],
* @dataProvider provideDelete
* @covers DatabaseBase::delete
*/
- function testDelete( $sql, $sqlText ) {
+ public function testDelete( $sql, $sqlText ) {
$this->database->delete(
$sql['table'],
$sql['conds'],
* @dataProvider provideUpsert
* @covers DatabaseBase::upsert
*/
- function testUpsert( $sql, $sqlText ) {
+ public function testUpsert( $sql, $sqlText ) {
$this->database->upsert(
$sql['table'],
$sql['rows'],
* @dataProvider provideDeleteJoin
* @covers DatabaseBase::deleteJoin
*/
- function testDeleteJoin( $sql, $sqlText ) {
+ public function testDeleteJoin( $sql, $sqlText ) {
$this->database->deleteJoin(
$sql['delTable'],
$sql['joinTable'],
* @dataProvider provideInsert
* @covers DatabaseBase::insert
*/
- function testInsert( $sql, $sqlText ) {
+ public function testInsert( $sql, $sqlText ) {
$this->database->insert(
$sql['table'],
$sql['rows'],
* @dataProvider provideInsertSelect
* @covers DatabaseBase::insertSelect
*/
- function testInsertSelect( $sql, $sqlText ) {
+ public function testInsertSelect( $sql, $sqlText ) {
$this->database->insertSelect(
$sql['destTable'],
$sql['srcTable'],
* @dataProvider provideReplace
* @covers DatabaseBase::replace
*/
- function testReplace( $sql, $sqlText ) {
+ public function testReplace( $sql, $sqlText ) {
$this->database->replace(
$sql['table'],
$sql['uniqueIndexes'],
* @dataProvider provideNativeReplace
* @covers DatabaseBase::nativeReplace
*/
- function testNativeReplace( $sql, $sqlText ) {
+ public function testNativeReplace( $sql, $sqlText ) {
$this->database->nativeReplace(
$sql['table'],
$sql['rows'],
* @dataProvider provideConditional
* @covers DatabaseBase::conditional
*/
- function testConditional( $sql, $sqlText ) {
+ public function testConditional( $sql, $sqlText ) {
$this->assertEquals( trim( $this->database->conditional(
$sql['conds'],
$sql['true'],
* @dataProvider provideBuildConcat
* @covers DatabaseBase::buildConcat
*/
- function testBuildConcat( $stringList, $sqlText ) {
+ public function testBuildConcat( $stringList, $sqlText ) {
$this->assertEquals( trim( $this->database->buildConcat(
$stringList
) ), $sqlText );
* @dataProvider provideBuildLike
* @covers DatabaseBase::buildLike
*/
- function testBuildLike( $array, $sqlText ) {
+ public function testBuildLike( $array, $sqlText ) {
$this->assertEquals( trim( $this->database->buildLike(
$array
) ), $sqlText );
* @dataProvider provideUnionQueries
* @covers DatabaseBase::unionQueries
*/
- function testUnionQueries( $sql, $sqlText ) {
+ public function testUnionQueries( $sql, $sqlText ) {
$this->assertEquals( trim( $this->database->unionQueries(
$sql['sqls'],
$sql['all']
/**
* @covers DatabaseBase::commit
*/
- function testTransactionCommit() {
+ public function testTransactionCommit() {
$this->database->begin( __METHOD__ );
$this->database->commit( __METHOD__ );
$this->assertLastSql( 'BEGIN; COMMIT' );
/**
* @covers DatabaseBase::rollback
*/
- function testTransactionRollback() {
+ public function testTransactionRollback() {
$this->database->begin( __METHOD__ );
$this->database->rollback( __METHOD__ );
$this->assertLastSql( 'BEGIN; ROLLBACK' );
/**
* @covers DatabaseBase::dropTable
*/
- function testDropTable() {
+ public function testDropTable() {
$this->database->setExistingTables( array( 'table' ) );
$this->database->dropTable( 'table', __METHOD__ );
$this->assertLastSql( 'DROP TABLE table' );
/**
* @covers DatabaseBase::dropTable
*/
- function testDropNonExistingTable() {
+ public function testDropNonExistingTable() {
$this->assertFalse(
$this->database->dropTable( 'non_existing', __METHOD__ )
);
return $indexes;
}
- function testCaseInsensitiveLike() {
+ public function testCaseInsensitiveLike() {
// TODO: Test this for all databases
$db = new DatabaseSqliteStandalone( ':memory:' );
$res = $db->query( 'SELECT "a" LIKE "A" AS a' );
/**
* @covers DatabaseBase::dropTable
*/
- function testAddQuotesNull() {
+ public function testAddQuotesNull() {
$check = "NULL";
if ( $this->db->getType() === 'sqlite' || $this->db->getType() === 'oracle' ) {
$check = "''";
$this->assertEquals( $check, $this->db->addQuotes( null ) );
}
- function testAddQuotesInt() {
+ public function testAddQuotesInt() {
# returning just "1234" should be ok too, though...
# maybe
$this->assertEquals(
$this->db->addQuotes( 1234 ) );
}
- function testAddQuotesFloat() {
+ public function testAddQuotesFloat() {
# returning just "1234.5678" would be ok too, though
$this->assertEquals(
"'1234.5678'",
$this->db->addQuotes( 1234.5678 ) );
}
- function testAddQuotesString() {
+ public function testAddQuotesString() {
$this->assertEquals(
"'string'",
$this->db->addQuotes( 'string' ) );
}
- function testAddQuotesStringQuote() {
+ public function testAddQuotesStringQuote() {
$check = "'string''s cause trouble'";
if ( $this->db->getType() === 'mysql' ) {
$check = "'string\'s cause trouble'";
}
}
- function testTableNameLocal() {
+ public function testTableNameLocal() {
$this->assertEquals(
$this->prefixAndQuote( 'tablename' ),
$this->db->tableName( 'tablename' )
);
}
- function testTableNameRawLocal() {
+ public function testTableNameRawLocal() {
$this->assertEquals(
$this->prefixAndQuote( 'tablename', null, null, 'raw' ),
$this->db->tableName( 'tablename', 'raw' )
);
}
- function testTableNameShared() {
+ public function testTableNameShared() {
$this->assertEquals(
$this->prefixAndQuote( 'tablename', 'sharedatabase', 'sh_' ),
$this->getSharedTableName( 'tablename', 'sharedatabase', 'sh_' )
);
}
- function testTableNameRawShared() {
+ public function testTableNameRawShared() {
$this->assertEquals(
$this->prefixAndQuote( 'tablename', 'sharedatabase', 'sh_', 'raw' ),
$this->getSharedTableName( 'tablename', 'sharedatabase', 'sh_', 'raw' )
);
}
- function testTableNameForeign() {
+ public function testTableNameForeign() {
$this->assertEquals(
$this->prefixAndQuote( 'tablename', 'databasename', '' ),
$this->db->tableName( 'databasename.tablename' )
);
}
- function testTableNameRawForeign() {
+ public function testTableNameRawForeign() {
$this->assertEquals(
$this->prefixAndQuote( 'tablename', 'databasename', '', 'raw' ),
$this->db->tableName( 'databasename.tablename', 'raw' )
);
}
- function testFillPreparedEmpty() {
+ public function testFillPreparedEmpty() {
$sql = $this->db->fillPrepared(
'SELECT * FROM interwiki', array() );
$this->assertEquals(
$sql );
}
- function testFillPreparedQuestion() {
+ public function testFillPreparedQuestion() {
$sql = $this->db->fillPrepared(
'SELECT * FROM cur WHERE cur_namespace=? AND cur_title=?',
array( 4, "Snicker's_paradox" ) );
$this->assertEquals( $check, $sql );
}
- function testFillPreparedBang() {
+ public function testFillPreparedBang() {
$sql = $this->db->fillPrepared(
'SELECT user_id FROM ! WHERE user_name=?',
array( '"user"', "Slash's Dot" ) );
$this->assertEquals( $check, $sql );
}
- function testFillPreparedRaw() {
+ public function testFillPreparedRaw() {
$sql = $this->db->fillPrepared(
"SELECT * FROM cur WHERE cur_title='This_\\&_that,_WTF\\?\\!'",
array( '"user"', "Slash's Dot" ) );
$sql );
}
- function testStoredFunctions() {
+ public function testStoredFunctions() {
if ( !in_array( wfGetDB( DB_MASTER )->getType(), array( 'mysql', 'postgres' ) ) ) {
$this->markTestSkipped( 'MySQL or Postgres required' );
}
);
}
- function testUnknownTableCorruptsResults() {
+ public function testUnknownTableCorruptsResults() {
$res = $this->db->select( 'page', '*', array( 'page_id' => 1 ) );
$this->assertFalse( $this->db->tableExists( 'foobarbaz' ) );
$this->assertInternalType( 'int', $res->numRows() );
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
* @author Daniel Kinzler
*/
+
+/**
+ * @covers PageORMTableForTesting
+ */
class ORMTableTest extends MediaWikiTestCase {
/**
*/
require_once __DIR__ . "/ORMRowTest.php";
+/**
+ * @covers TestORMRow
+ */
class TestORMRowTest extends ORMRowTest {
/**
parent::tearDown();
}
- function testAddLog() {
+ /**
+ * @covers MWDebug::log
+ */
+ public function testAddLog() {
MWDebug::log( 'logging a string' );
$this->assertEquals(
array( array(
);
}
- function testAddWarning() {
+ /**
+ * @covers MWDebug::warning
+ */
+ public function testAddWarning() {
MWDebug::warning( 'Warning message' );
$this->assertEquals(
array( array(
);
}
- function testAvoidDuplicateDeprecations() {
+ /**
+ * @covers MWDebug::deprecated
+ */
+ public function testAvoidDuplicateDeprecations() {
MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' );
MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' );
);
}
- function testAvoidNonConsecutivesDuplicateDeprecations() {
+ /**
+ * @covers MWDebug::deprecated
+ */
+ public function testAvoidNonConsecutivesDuplicateDeprecations() {
MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' );
MWDebug::warning( 'some warning' );
MWDebug::log( 'we could have logged something too' );
* @expectedException MWException
* @covers FileRepo::__construct
*/
- function testFileRepoConstructionOptionCanNotBeNull() {
+ public function testFileRepoConstructionOptionCanNotBeNull() {
new FileRepo();
}
* @expectedException MWException
* @covers FileRepo::__construct
*/
- function testFileRepoConstructionOptionCanNotBeAnEmptyArray() {
+ public function testFileRepoConstructionOptionCanNotBeAnEmptyArray() {
new FileRepo( array() );
}
* @expectedException MWException
* @covers FileRepo::__construct
*/
- function testFileRepoConstructionOptionNeedNameKey() {
+ public function testFileRepoConstructionOptionNeedNameKey() {
new FileRepo( array(
'backend' => 'foobar'
) );
* @expectedException MWException
* @covers FileRepo::__construct
*/
- function testFileRepoConstructionOptionNeedBackendKey() {
+ public function testFileRepoConstructionOptionNeedBackendKey() {
new FileRepo( array(
'name' => 'foobar'
) );
/**
* @covers FileRepo::__construct
*/
- function testFileRepoConstructionWithRequiredOptions() {
+ public function testFileRepoConstructionWithRequiredOptions() {
$f = new FileRepo( array(
'name' => 'FileRepoTestRepository',
'backend' => new FSFileBackend( array(
* @covers InstallDocFormatter::format
* @dataProvider provideDocFormattingTests
*/
- function testFormat( $expected, $unformattedText, $message = '' ) {
+ public function testFormat( $expected, $unformattedText, $message = '' ) {
$this->assertEquals(
$expected,
InstallDocFormatter::format( $unformattedText ),
* @dataProvider provideOracleConnectStrings
* @covers OracleInstaller::checkConnectStringFormat
*/
- function testCheckConnectStringFormat( $expected, $connectString, $msg = '' ) {
+ public function testCheckConnectStringFormat( $expected, $connectString, $msg = '' ) {
$validity = $expected ? 'should be valid' : 'should NOT be valid';
$msg = "'$connectString' ($msg) $validity.";
$this->assertEquals( $expected,
/**
* @dataProvider provider_queueLists
+ * @covers JobQueue::getWiki
*/
- function testProperties( $queue, $recycles, $desc ) {
+ public function testGetWiki( $queue, $recycles, $desc ) {
$queue = $this->$queue;
if ( !$queue ) {
$this->markTestSkipped( $desc );
}
-
$this->assertEquals( wfWikiID(), $queue->getWiki(), "Proper wiki ID ($desc)" );
+ }
+
+ /**
+ * @dataProvider provider_queueLists
+ * @covers JobQueue::getType
+ */
+ public function testGetType( $queue, $recycles, $desc ) {
+ $queue = $this->$queue;
+ if ( !$queue ) {
+ $this->markTestSkipped( $desc );
+ }
$this->assertEquals( 'null', $queue->getType(), "Proper job type ($desc)" );
}
/**
* @dataProvider provider_queueLists
+ * @covers JobQueue
*/
- function testBasicOperations( $queue, $recycles, $desc ) {
+ public function testBasicOperations( $queue, $recycles, $desc ) {
$queue = $this->$queue;
if ( !$queue ) {
$this->markTestSkipped( $desc );
/**
* @dataProvider provider_queueLists
+ * @covers JobQueue
*/
- function testBasicDeduplication( $queue, $recycles, $desc ) {
+ public function testBasicDeduplication( $queue, $recycles, $desc ) {
$queue = $this->$queue;
if ( !$queue ) {
$this->markTestSkipped( $desc );
/**
* @dataProvider provider_queueLists
+ * @covers JobQueue
*/
- function testRootDeduplication( $queue, $recycles, $desc ) {
+ public function testRootDeduplication( $queue, $recycles, $desc ) {
$queue = $this->$queue;
if ( !$queue ) {
$this->markTestSkipped( $desc );
/**
* @dataProvider provider_fifoQueueLists
+ * @covers JobQueue
*/
- function testJobOrder( $queue, $recycles, $desc ) {
+ public function testJobOrder( $queue, $recycles, $desc ) {
$queue = $this->$queue;
if ( !$queue ) {
$this->markTestSkipped( $desc );
<?php
+/**
+ * @covers FormatJson
+ */
class FormatJsonTest extends MediaWikiTestCase {
public function testEncoderPrettyPrinting() {
/**
* @dataProvider provideMinifyCases
+ * @covers CSSMin::minify
*/
- function testMinify( $code, $expectedOutput ) {
+ public function testMinify( $code, $expectedOutput ) {
$minified = CSSMin::minify( $code );
$this->assertEquals( $expectedOutput, $minified, 'Minified output should be in the form expected.' );
/**
* @dataProvider provideRemapCases
+ * @covers CSSMin::remap
*/
- function testRemap( $message, $params, $expectedOutput ) {
+ public function testRemap( $message, $params, $expectedOutput ) {
$remapped = call_user_func_array( 'CSSMin::remap', $params );
$messageAdd = " Case: $message";
*
* @group Broken
* @dataProvider provideStringCases
+ * @covers CSSMin::remap
*/
- function testMinifyWithCSSStringValues( $code, $expectedOutput ) {
+ public function testMinifyWithCSSStringValues( $code, $expectedOutput ) {
$this->testMinifyOutput( $code, $expectedOutput );
}
* @since 1.20
*
* @param array $elements
+ *
+ * @covers GenericArrayObject::__construct
*/
public function testConstructor( array $elements ) {
$arrayObject = $this->getNew( $elements );
* @since 1.20
*
* @param array $elements
+ *
+ * @covers GenericArrayObject::isEmpty
*/
public function testIsEmpty( array $elements ) {
$arrayObject = $this->getNew( $elements );
* @since 1.20
*
* @param GenericArrayObject $list
+ *
+ * @covers GenericArrayObject::offsetUnset
*/
public function testUnset( GenericArrayObject $list ) {
if ( $list->isEmpty() ) {
* @since 1.20
*
* @param array $elements
+ *
+ * @covers GenericArrayObject::append
*/
public function testAppend( array $elements ) {
$list = $this->getNew();
* @since 1.20
*
* @param callback $function
+ *
+ * @covers GenericArrayObject::getObjectType
*/
protected function checkTypeChecks( $function ) {
$excption = null;
* @since 1.20
*
* @param array $elements
+ *
+ * @covers GenericArrayObject::offsetSet
*/
public function testOffsetSet( array $elements ) {
if ( $elements === array() ) {
* @since 1.21
*
* @param GenericArrayObject $list
+ *
+ * @covers GenericArrayObject::getSerializationData
+ * @covers GenericArrayObject::serialize
+ * @covers GenericArrayObject::unserialize
*/
public function testSerialization( GenericArrayObject $list ) {
$serialization = serialize( $list );
/**
* Tests for IEUrlExtension::findIE6Extension
+ * @todo tests below for findIE6Extension should be split into...
+ * ...a dataprovider and test method.
*/
class IEUrlExtensionTest extends MediaWikiTestCase {
- function testSimple() {
+ /**
+ * @covers IEUrlExtension::findIE6Extension
+ */
+ public function testSimple() {
$this->assertEquals(
'y',
IEUrlExtension::findIE6Extension( 'x.y' ),
);
}
- function testSimpleNoExt() {
+ /**
+ * @covers IEUrlExtension::findIE6Extension
+ */
+ public function testSimpleNoExt() {
$this->assertEquals(
'',
IEUrlExtension::findIE6Extension( 'x' ),
);
}
- function testEmpty() {
+ /**
+ * @covers IEUrlExtension::findIE6Extension
+ */
+ public function testEmpty() {
$this->assertEquals(
'',
IEUrlExtension::findIE6Extension( '' ),
);
}
- function testQuestionMark() {
+ /**
+ * @covers IEUrlExtension::findIE6Extension
+ */
+ public function testQuestionMark() {
$this->assertEquals(
'',
IEUrlExtension::findIE6Extension( '?' ),
);
}
- function testExtQuestionMark() {
+ /**
+ * @covers IEUrlExtension::findIE6Extension
+ */
+ public function testExtQuestionMark() {
$this->assertEquals(
'x',
IEUrlExtension::findIE6Extension( '.x?' ),
);
}
- function testQuestionMarkExt() {
+ /**
+ * @covers IEUrlExtension::findIE6Extension
+ */
+ public function testQuestionMarkExt() {
$this->assertEquals(
'x',
IEUrlExtension::findIE6Extension( '?.x' ),
);
}
- function testInvalidChar() {
+ /**
+ * @covers IEUrlExtension::findIE6Extension
+ */
+ public function testInvalidChar() {
$this->assertEquals(
'',
IEUrlExtension::findIE6Extension( '.x*' ),
);
}
- function testInvalidCharThenExtension() {
+ /**
+ * @covers IEUrlExtension::findIE6Extension
+ */
+ public function testInvalidCharThenExtension() {
$this->assertEquals(
'x',
IEUrlExtension::findIE6Extension( '*.x' ),
);
}
- function testMultipleQuestionMarks() {
+ /**
+ * @covers IEUrlExtension::findIE6Extension
+ */
+ public function testMultipleQuestionMarks() {
$this->assertEquals(
'c',
IEUrlExtension::findIE6Extension( 'a?b?.c?.d?e?f' ),
);
}
- function testExeException() {
+ /**
+ * @covers IEUrlExtension::findIE6Extension
+ */
+ public function testExeException() {
$this->assertEquals(
'd',
IEUrlExtension::findIE6Extension( 'a?b?.exe?.d?.e' ),
);
}
- function testExeException2() {
+ /**
+ * @covers IEUrlExtension::findIE6Extension
+ */
+ public function testExeException2() {
$this->assertEquals(
'exe',
IEUrlExtension::findIE6Extension( 'a?b?.exe' ),
);
}
- function testHash() {
+ /**
+ * @covers IEUrlExtension::findIE6Extension
+ */
+ public function testHash() {
$this->assertEquals(
'',
IEUrlExtension::findIE6Extension( 'a#b.c' ),
);
}
- function testHash2() {
+ /**
+ * @covers IEUrlExtension::findIE6Extension
+ */
+ public function testHash2() {
$this->assertEquals(
'',
IEUrlExtension::findIE6Extension( 'a?#b.c' ),
);
}
- function testDotAtEnd() {
+ /**
+ * @covers IEUrlExtension::findIE6Extension
+ */
+ public function testDotAtEnd() {
$this->assertEquals(
'',
IEUrlExtension::findIE6Extension( '.' ),
);
}
- function testTwoDots() {
+ /**
+ * @covers IEUrlExtension::findIE6Extension
+ */
+ public function testTwoDots() {
$this->assertEquals(
'z',
IEUrlExtension::findIE6Extension( 'x.y.z' ),
/**
* @dataProvider provideCases
+ * @covers JavaScriptMinifier::minify
*/
- function testJavaScriptMinifierOutput( $code, $expectedOutput ) {
+ public function testJavaScriptMinifierOutput( $code, $expectedOutput ) {
$minified = JavaScriptMinifier::minify( $code );
// JSMin+'s parser will throw an exception if output is not valid JS.
/**
* @dataProvider provideBug32548
+ * @covers JavaScriptMinifier::minify
*/
- function testBug32548Exponent( $num ) {
+ public function testBug32548Exponent( $num ) {
// Long line breaking was being incorrectly done between the base and
// exponent part of a number, causing a syntax error. The line should
// instead break at the start of the number.
return $logEntry;
}
+ /**
+ * @covers LogFormatter::newFromEntry
+ */
public function testNormalLogParams() {
$entry = $this->newLogEntry( 'test', array() );
$formatter = LogFormatter::newFromEntry( $entry );
$this->assertEquals( $titleLink, $paramsWithoutTools[2]['raw'] );
}
+ /**
+ * @covers LogFormatter::newFromEntry
+ * @covers LogFormatter::getActionText
+ */
public function testLogParamsTypeRaw() {
$params = array( '4:raw:raw' => Linker::link( $this->title, null, array(), array() ) );
$expected = Linker::link( $this->title, null, array(), array() );
$this->assertEquals( $expected, $logParam );
}
+ /**
+ * @covers LogFormatter::newFromEntry
+ * @covers LogFormatter::getActionText
+ */
public function testLogParamsTypeMsg() {
$params = array( '4:msg:msg' => 'log-description-phpunit' );
$expected = wfMessage( 'log-description-phpunit' )->text();
$this->assertEquals( $expected, $logParam );
}
+ /**
+ * @covers LogFormatter::newFromEntry
+ * @covers LogFormatter::getActionText
+ */
public function testLogParamsTypeMsgContent() {
$params = array( '4:msg-content:msgContent' => 'log-description-phpunit' );
$expected = wfMessage( 'log-description-phpunit' )->inContentLanguage()->text();
$this->assertEquals( $expected, $logParam );
}
+ /**
+ * @covers LogFormatter::newFromEntry
+ * @covers LogFormatter::getActionText
+ */
public function testLogParamsTypeNumber() {
global $wgLang;
$this->assertEquals( $expected, $logParam );
}
+ /**
+ * @covers LogFormatter::newFromEntry
+ * @covers LogFormatter::getActionText
+ */
public function testLogParamsTypeUserLink() {
$params = array( '4:user-link:userLink' => $this->user->getName() );
$expected = Linker::userLink(
$this->assertEquals( $expected, $logParam );
}
+ /**
+ * @covers LogFormatter::newFromEntry
+ * @covers LogFormatter::getActionText
+ */
public function testLogParamsTypeTitleLink() {
$params = array( '4:title-link:titleLink' => $this->title->getText() );
$expected = Linker::link( $this->title, null, array(), array() );
$this->assertEquals( $expected, $logParam );
}
+ /**
+ * @covers LogFormatter::newFromEntry
+ * @covers LogFormatter::getActionText
+ */
public function testLogParamsTypePlain() {
$params = array( '4:plain:plain' => 'Some plain text' );
$expected = 'Some plain text';
$this->assertEquals( $expected, $logParam );
}
+ /**
+ * @covers LogFormatter::newFromEntry
+ * @covers LogFormatter::getComment
+ */
public function testLogComment() {
$entry = $this->newLogEntry( 'test', array() );
$formatter = LogFormatter::newFromEntry( $entry );
* Basically the file has IPTC and XMP metadata, the
* IPTC should override the XMP, except for the multilingual
* translation (to en) where XMP should win.
+ * @covers BitmapMetadataHandler::Jpeg
*/
public function testMultilingualCascade() {
if ( !extension_loaded( 'exif' ) ) {
*
* There's more extensive tests of comment extraction in
* JpegMetadataExtractorTests.php
+ * @covers BitmapMetadataHandler::Jpeg
*/
public function testJpegComment() {
$meta = BitmapMetadataHandler::Jpeg( $this->filePath .
/**
* Make sure a bad iptc block doesn't stop the other metadata
* from being extracted.
+ * @covers BitmapMetadataHandler::Jpeg
*/
public function testBadIPTC() {
$meta = BitmapMetadataHandler::Jpeg( $this->filePath .
$this->assertEquals( 'Created with GIMP', $meta['JPEGFileComment'][0] );
}
+ /**
+ * @covers BitmapMetadataHandler::Jpeg
+ */
public function testIPTCDates() {
$meta = BitmapMetadataHandler::Jpeg( $this->filePath .
'iptc-timetest.jpg' );
/**
* File has an invalid time (+ one valid but really weird time)
* that shouldn't be included
+ * @covers BitmapMetadataHandler::Jpeg
*/
public function testIPTCDatesInvalid() {
$meta = BitmapMetadataHandler::Jpeg( $this->filePath .
* XMP data should take priority over iptc data
* when hash has been updated, but not when
* the hash is wrong.
+ * @covers BitmapMetadataHandler::addMetadata
+ * @covers BitmapMetadataHandler::getMetadataArray
*/
public function testMerging() {
$merger = new BitmapMetadataHandler();
$this->assertEquals( $expected, $actual );
}
+ /**
+ * @covers BitmapMetadataHandler::png
+ */
public function testPNGXMP() {
if ( !extension_loaded( 'xml' ) ) {
$this->markTestSkipped( "This test needs the xml extension." );
$this->assertEquals( $expected, $result );
}
+ /**
+ * @covers BitmapMetadataHandler::png
+ */
public function testPNGNative() {
$handler = new BitmapMetadataHandler();
$result = $handler->png( $this->filePath . 'Png-native-test.png' );
$this->assertEquals( $expected, $result['metadata']['Identifier']['x-default'] );
}
+ /**
+ * @covers BitmapMetadataHandler::getTiffByteOrder
+ */
public function testTiffByteOrder() {
$handler = new BitmapMetadataHandler();
$res = $handler->getTiffByteOrder( $this->filePath . 'test.tiff' );
/**
* @dataProvider provideNormaliseParams
+ * @covers BitmapHandler::normaliseParams
*/
- function testNormaliseParams( $fileDimensions, $expectedParams, $params, $msg ) {
+ public function testNormaliseParams( $fileDimensions, $expectedParams, $params, $msg ) {
$file = new FakeDimensionFile( $fileDimensions );
$handler = new BitmapHandler;
$valid = $handler->normaliseParams( $file, $params );
);
}
- function testTooBigImage() {
+ /**
+ * @covers BitmapHandler::doTransform
+ */
+ public function testTooBigImage() {
$file = new FakeDimensionFile( array( 4000, 4000 ) );
$handler = new BitmapHandler;
$params = array( 'width' => '3700' ); // Still bigger than max size.
get_class( $handler->doTransform( $file, 'dummy path', '', $params ) ) );
}
- function testTooBigMustRenderImage() {
+ /**
+ * @covers BitmapHandler::doTransform
+ */
+ public function testTooBigMustRenderImage() {
$file = new FakeDimensionFile( array( 4000, 4000 ) );
$file->mustRender = true;
$handler = new BitmapHandler;
get_class( $handler->doTransform( $file, 'dummy path', '', $params ) ) );
}
- function testImageArea() {
+ /**
+ * @covers BitmapHandler::getImageArea
+ */
+ public function testImageArea() {
$file = new FakeDimensionFile( array( 7, 9 ) );
$handler = new BitmapHandler;
$this->assertEquals( 63, $handler->getImageArea( $file ) );
}
}
-
-class FakeDimensionFile extends File {
- public $mustRender = false;
-
- public function __construct( $dimensions ) {
- parent::__construct( Title::makeTitle( NS_FILE, 'Test' ),
- new NullRepo( null ) );
-
- $this->dimensions = $dimensions;
- }
-
- public function getWidth( $page = 1 ) {
- return $this->dimensions[0];
- }
-
- public function getHeight( $page = 1 ) {
- return $this->dimensions[1];
- }
-
- public function mustRender() {
- return $this->mustRender;
- }
-
- public function getPath() {
- return '';
- }
-}
class ExifBitmapTest extends MediaWikiTestCase {
+ /**
+ * @var ExifBitmapHandler
+ */
+ protected $handler;
+
protected function setUp() {
parent::setUp();
if ( !extension_loaded( 'exif' ) ) {
}
+ /**
+ * @covers ExifBitmapHandler::isMetadataValid
+ */
public function testIsOldBroken() {
$res = $this->handler->isMetadataValid( null, ExifBitmapHandler::OLD_BROKEN_FILE );
$this->assertEquals( ExifBitmapHandler::METADATA_COMPATIBLE, $res );
}
+ /**
+ * @covers ExifBitmapHandler::isMetadataValid
+ */
public function testIsBrokenFile() {
$res = $this->handler->isMetadataValid( null, ExifBitmapHandler::BROKEN_FILE );
$this->assertEquals( ExifBitmapHandler::METADATA_GOOD, $res );
}
+ /**
+ * @covers ExifBitmapHandler::isMetadataValid
+ */
public function testIsInvalid() {
$res = $this->handler->isMetadataValid( null, 'Something Invalid Here.' );
$this->assertEquals( ExifBitmapHandler::METADATA_BAD, $res );
}
+ /**
+ * @covers ExifBitmapHandler::isMetadataValid
+ */
public function testGoodMetadata() {
$meta = 'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:2;}';
$res = $this->handler->isMetadataValid( null, $meta );
$this->assertEquals( ExifBitmapHandler::METADATA_GOOD, $res );
}
+ /**
+ * @covers ExifBitmapHandler::isMetadataValid
+ */
public function testIsOldGood() {
$meta = 'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:1;}';
$res = $this->handler->isMetadataValid( null, $meta );
$this->assertEquals( ExifBitmapHandler::METADATA_COMPATIBLE, $res );
}
- // Handle metadata from paged tiff handler (gotten via instant commons)
- // gracefully.
+ /**
+ * Handle metadata from paged tiff handler (gotten via instant commons) gracefully.
+ * @covers ExifBitmapHandler::isMetadataValid
+ */
public function testPagedTiffHandledGracefully() {
$meta = 'a:6:{s:9:"page_data";a:1:{i:1;a:5:{s:5:"width";i:643;s:6:"height";i:448;s:5:"alpha";s:4:"true";s:4:"page";i:1;s:6:"pixels";i:288064;}}s:10:"page_count";i:1;s:10:"first_page";i:1;s:9:"last_page";i:1;s:4:"exif";a:9:{s:10:"ImageWidth";i:643;s:11:"ImageLength";i:448;s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:4;s:12:"RowsPerStrip";i:50;s:19:"PlanarConfiguration";i:1;s:22:"MEDIAWIKI_EXIF_VERSION";i:1;}s:21:"TIFF_METADATA_VERSION";s:3:"1.4";}';
$res = $this->handler->isMetadataValid( null, $meta );
$this->assertEquals( ExifBitmapHandler::METADATA_BAD, $res );
}
- function testConvertMetadataLatest() {
+ /**
+ * @covers ExifBitmapHandler::convertMetadataVersion
+ */
+ public function testConvertMetadataLatest() {
$metadata = array(
'foo' => array( 'First', 'Second', '_type' => 'ol' ),
'MEDIAWIKI_EXIF_VERSION' => 2
$this->assertEquals( $metadata, $res );
}
- function testConvertMetadataToOld() {
+ /**
+ * @covers ExifBitmapHandler::convertMetadataVersion
+ */
+ public function testConvertMetadataToOld() {
$metadata = array(
'foo' => array( 'First', 'Second', '_type' => 'ol' ),
'bar' => array( 'First', 'Second', '_type' => 'ul' ),
$this->assertEquals( $expected, $res );
}
- function testConvertMetadataSoftware() {
+ /**
+ * @covers ExifBitmapHandler::convertMetadataVersion
+ */
+ public function testConvertMetadataSoftware() {
$metadata = array(
'Software' => array( array( 'GIMP', '1.1' ) ),
'MEDIAWIKI_EXIF_VERSION' => 2,
$this->assertEquals( $expected, $res );
}
- function testConvertMetadataSoftwareNormal() {
+ /**
+ * @covers ExifBitmapHandler::convertMetadataVersion
+ */
+ public function testConvertMetadataSoftwareNormal() {
$metadata = array(
'Software' => array( "GIMP 1.2", "vim" ),
'MEDIAWIKI_EXIF_VERSION' => 2,
* Tests related to auto rotation.
*
* @group medium
+ *
+ * @todo covers tags
*/
class ExifRotationTest extends MediaWikiTestCase {
}
/**
- *
* @dataProvider provideFiles
*/
- function testMetadata( $name, $type, $info ) {
+ public function testMetadata( $name, $type, $info ) {
if ( !BitmapHandler::canRotate() ) {
$this->markTestSkipped( "This test needs a rasterizer that can auto-rotate." );
}
*
* @dataProvider provideFiles
*/
- function testRotationRendering( $name, $type, $info, $thumbs ) {
+ public function testRotationRendering( $name, $type, $info, $thumbs ) {
if ( !BitmapHandler::canRotate() ) {
$this->markTestSkipped( "This test needs a rasterizer that can auto-rotate." );
}
* Same as before, but with auto-rotation disabled.
* @dataProvider provideFilesNoAutoRotate
*/
- function testMetadataNoAutoRotate( $name, $type, $info ) {
+ public function testMetadataNoAutoRotate( $name, $type, $info ) {
$this->setMwGlobals( 'wgEnableAutoRotation', false );
$file = $this->dataFile( $name, $type );
*
* @dataProvider provideFilesNoAutoRotate
*/
- function testRotationRenderingNoAutoRotate( $name, $type, $info, $thumbs ) {
+ public function testRotationRenderingNoAutoRotate( $name, $type, $info, $thumbs ) {
$this->setMwGlobals( 'wgEnableAutoRotation', false );
foreach ( $thumbs as $size => $out ) {
/**
* @dataProvider provideBitmapExtractPreRotationDimensions
*/
- function testBitmapExtractPreRotationDimensions( $rotation, $expected ) {
+ public function testBitmapExtractPreRotationDimensions( $rotation, $expected ) {
$result = $this->handler->extractPreRotationDimensions( array(
'physicalWidth' => self::TEST_WIDTH,
'physicalHeight' => self::TEST_HEIGHT,
<?php
+
+/**
+ * @covers Exif
+ */
class ExifTest extends MediaWikiTestCase {
+ /** @var string */
+ protected $mediaPath;
+
protected function setUp() {
parent::setUp();
if ( !extension_loaded( 'exif' ) ) {
--- /dev/null
+<?php
+
+class FakeDimensionFile extends File {
+ public $mustRender = false;
+
+ public function __construct( $dimensions ) {
+ parent::__construct( Title::makeTitle( NS_FILE, 'Test' ),
+ new NullRepo( null ) );
+
+ $this->dimensions = $dimensions;
+ }
+
+ public function getWidth( $page = 1 ) {
+ return $this->dimensions[0];
+ }
+
+ public function getHeight( $page = 1 ) {
+ return $this->dimensions[1];
+ }
+
+ public function mustRender() {
+ return $this->mustRender;
+ }
+
+ public function getPath() {
+ return '';
+ }
+}
\ No newline at end of file
<?php
+
class FormatMetadataTest extends MediaWikiTestCase {
+ /** @var FSFileBackend */
+ protected $backend;
+ /** @var FSRepo */
+ protected $repo;
+
protected function setUp() {
parent::setUp();
$this->setMwGlobals( 'wgShowEXIF', true );
}
+ /**
+ * @covers File::formatMetadata
+ */
public function testInvalidDate() {
$file = $this->dataFile( 'broken_exif_date.jpg', 'image/jpeg' );
* @param $filename String
* @param $expected Array The extracted metadata.
* @dataProvider provideGetMetadata
+ * @covers GIFMetadataExtractor::getMetadata
*/
public function testGetMetadata( $filename, $expected ) {
$actual = GIFMetadataExtractor::getMetadata( $this->mediaPath . $filename );
<?php
class GIFHandlerTest extends MediaWikiTestCase {
+ /** @var FSFileBackend */
+ protected $backend;
+ /** @var GIFHandler */
+ protected $handler;
+ /** @var FSRepo */
+ protected $repo;
+ /** @var string */
+ protected $filePath;
+
protected function setUp() {
parent::setUp();
$this->handler = new GIFHandler();
}
+ /**
+ * @covers GIFHandler::getMetadata
+ */
public function testInvalidFile() {
$res = $this->handler->getMetadata( null, $this->filePath . '/README' );
$this->assertEquals( GIFHandler::BROKEN_FILE, $res );
* @param $filename String basename of the file to check
* @param $expected boolean Expected result.
* @dataProvider provideIsAnimated
+ * @covers GIFHandler::isAnimatedImage
*/
public function testIsAnimanted( $filename, $expected ) {
$file = $this->dataFile( $filename, 'image/gif' );
* @param $filename String
* @param $expected Integer Total image area
* @dataProvider provideGetImageArea
+ * @covers GIFHandler::getImageArea
*/
public function testGetImageArea( $filename, $expected ) {
$file = $this->dataFile( $filename, 'image/gif' );
* @param $metadata String Serialized metadata
* @param $expected Integer One of the class constants of GIFHandler
* @dataProvider provideIsMetadataValid
+ * @covers GIFHandler::isMetadataValid
*/
public function testIsMetadataValid( $metadata, $expected ) {
$actual = $this->handler->isMetadataValid( null, $metadata );
* @param $filename String
* @param $expected String Serialized array
* @dataProvider provideGetMetadata
+ * @covers GIFHandler::getMetadata
*/
public function testGetMetadata( $filename, $expected ) {
$file = $this->dataFile( $filename, 'image/gif' );
<?php
+
class IPTCTest extends MediaWikiTestCase {
+
+ /**
+ * @covers IPTC::getCharset
+ */
public function testRecognizeUtf8() {
// utf-8 is the only one used in practise.
$res = IPTC::getCharset( "\x1b%G" );
$this->assertEquals( 'UTF-8', $res );
}
+ /**
+ * @covers IPTC::Parse
+ */
public function testIPTCParseNoCharset88591() {
// basically IPTC for keyword with value of 0xBC which is 1/4 in iso-8859-1
// This data doesn't specify a charset. We're supposed to guess
$this->assertEquals( array( '¼' ), $res['Keywords'] );
}
- /* This one contains a sequence that's valid iso 8859-1 but not valid utf8 */
- /* \xC3 = Ã, \xB8 = ¸ */
+ /**
+ * @covers IPTC::Parse
+ */
public function testIPTCParseNoCharset88591b() {
+ /* This one contains a sequence that's valid iso 8859-1 but not valid utf8 */
+ /* \xC3 = Ã, \xB8 = ¸ */
$iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x09\x1c\x02\x19\x00\x04\xC3\xC3\xC3\xB8";
$res = IPTC::Parse( $iptcData );
$this->assertEquals( array( 'ÃÃø' ), $res['Keywords'] );
}
- /* Same as testIPTCParseNoCharset88591b, but forcing the charset to utf-8.
+ /**
+ * Same as testIPTCParseNoCharset88591b, but forcing the charset to utf-8.
* What should happen is the first "\xC3\xC3" should be dropped as invalid,
* leaving \xC3\xB8, which is ø
+ * @covers IPTC::Parse
*/
public function testIPTCParseForcedUTFButInvalid() {
$iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x11\x1c\x02\x19\x00\x04\xC3\xC3\xC3\xB8"
$this->assertEquals( array( 'ø' ), $res['Keywords'] );
}
+ /**
+ * @covers IPTC::Parse
+ */
public function testIPTCParseNoCharsetUTF8() {
$iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x07\x1c\x02\x19\x00\x02¼";
$res = IPTC::Parse( $iptcData );
$this->assertEquals( array( '¼' ), $res['Keywords'] );
}
- // Testing something that has 2 values for keyword
+ /**
+ * Testing something that has 2 values for keyword
+ * @covers IPTC::Parse
+ */
public function testIPTCParseMulti() {
$iptcData = /* identifier */ "Photoshop 3.0\08BIM\4\4"
/* length */ . "\0\0\0\0\0\x0D"
$this->assertEquals( array( '¼', '¼½' ), $res['Keywords'] );
}
+ /**
+ * @covers IPTC::Parse
+ */
public function testIPTCParseUTF8() {
// This has the magic "\x1c\x01\x5A\x00\x03\x1B\x25\x47" which marks content as UTF8.
$iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x0F\x1c\x02\x19\x00\x02¼\x1c\x01\x5A\x00\x03\x1B\x25\x47";
* serve as a very good "test". (Adobe photoshop probably creates such files
* but it costs money). The implementation of it currently in MediaWiki is based
* solely on reading the standard, without any real world test files.
+ *
+ * @covers JpegMetadataExtractor
*/
class JpegMetadataExtractorTest extends MediaWikiTestCase {
+ protected $filePath;
+
protected function setUp() {
parent::setUp();
* We also use this test to test padding bytes don't
* screw stuff up
*
- * @param $file filename
+ * @param string $file filename
*
* @dataProvider provideUtf8Comment
*/
<?php
+/**
+ * @covers JpegHandler
+ */
class JpegTest extends MediaWikiTestCase {
+ protected $filePath;
+
protected function setUp() {
parent::setUp();
if ( !extension_loaded( 'exif' ) ) {
<?php
class MediaHandlerTest extends MediaWikiTestCase {
- function testFitBoxWidth() {
+
+ /**
+ * @covers MediaHandler::fitBoxWidth
+ * @todo split into a dataprovider and test method
+ */
+ public function testFitBoxWidth() {
$vals = array(
array(
'width' => 50,
<?php
+
+/**
+ * @covers PNGMetadataExtractor
+ */
class PNGMetadataExtractorTest extends MediaWikiTestCase {
protected function setUp() {
/**
* Tests zTXt tag (compressed textual metadata)
*/
- function testPngNativetZtxt() {
+ public function testPngNativetZtxt() {
$this->checkPHPExtension( 'zlib' );
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
/**
* Test tEXt tag (Uncompressed textual metadata)
*/
- function testPngNativeText() {
+ public function testPngNativeText() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'Png-native-test.png' );
$expected = "Some long image desc";
* tEXt tags must be encoded iso-8859-1 (vs iTXt which are utf-8)
* Make sure non-ascii characters get converted properly
*/
- function testPngNativeTextNonAscii() {
+ public function testPngNativeTextNonAscii() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'Png-native-test.png' );
* actual resolution of the image is (aka in dots per meter).
*/
/*
- function testPngPhysTag() {
+ public function testPngPhysTag() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'Png-native-test.png' );
/**
* Given a normal static PNG, check the animation metadata returned.
*/
- function testStaticPngAnimationMetadata() {
+ public function testStaticPngAnimationMetadata() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'Png-native-test.png' );
* Given an animated APNG image file
* check it gets animated metadata right.
*/
- function testApngAnimationMetadata() {
+ public function testApngAnimationMetadata() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'Animated_PNG_example_bouncing_beach_ball.png' );
$this->assertEquals( 1.5, $meta['duration'], '', 0.00001 );
}
- function testPngBitDepth8() {
+ public function testPngBitDepth8() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'Png-native-test.png' );
$this->assertEquals( 8, $meta['bitDepth'] );
}
- function testPngBitDepth1() {
+ public function testPngBitDepth1() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'1bit-png.png' );
$this->assertEquals( 1, $meta['bitDepth'] );
}
- function testPngIndexColour() {
+ public function testPngIndexColour() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'Png-native-test.png' );
$this->assertEquals( 'index-coloured', $meta['colorType'] );
}
- function testPngRgbColour() {
+ public function testPngRgbColour() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'rgb-png.png' );
$this->assertEquals( 'truecolour-alpha', $meta['colorType'] );
}
- function testPngRgbNoAlphaColour() {
+ public function testPngRgbNoAlphaColour() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'rgb-na-png.png' );
$this->assertEquals( 'truecolour', $meta['colorType'] );
}
- function testPngGreyscaleColour() {
+ public function testPngGreyscaleColour() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'greyscale-png.png' );
$this->assertEquals( 'greyscale-alpha', $meta['colorType'] );
}
- function testPngGreyscaleNoAlphaColour() {
+ public function testPngGreyscaleNoAlphaColour() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'greyscale-na-png.png' );
$this->assertEquals( 'greyscale', $meta['colorType'] );
<?php
class PNGHandlerTest extends MediaWikiTestCase {
+ /** @var PNGHandler */
+ protected $handler;
+ /** @var FSRepo */
+ protected $repo;
+ /** @var FSFileBackend */
+ protected $backend;
+ /** @var string */
+ protected $filePath;
+
protected function setUp() {
parent::setUp();
$this->handler = new PNGHandler();
}
+ /**
+ * @covers PNGHandler::getMetadata
+ */
public function testInvalidFile() {
$res = $this->handler->getMetadata( null, $this->filePath . '/README' );
$this->assertEquals( PNGHandler::BROKEN_FILE, $res );
* @param $filename String basename of the file to check
* @param $expected boolean Expected result.
* @dataProvider provideIsAnimated
+ * @covers PNGHandler::isAnimatedImage
*/
public function testIsAnimanted( $filename, $expected ) {
$file = $this->dataFile( $filename, 'image/png' );
* @param $filename String
* @param $expected Integer Total image area
* @dataProvider provideGetImageArea
+ * @covers PNGHandler::getImageArea
*/
public function testGetImageArea( $filename, $expected ) {
$file = $this->dataFile( $filename, 'image/png' );
* @param $metadata String Serialized metadata
* @param $expected Integer One of the class constants of PNGHandler
* @dataProvider provideIsMetadataValid
+ * @covers PNGHandler::isMetadataValid
*/
public function testIsMetadataValid( $metadata, $expected ) {
$actual = $this->handler->isMetadataValid( null, $metadata );
* @param $filename String
* @param $expected String Serialized array
* @dataProvider provideGetMetadata
+ * @covers PNGHandler::getMetadata
*/
public function testGetMetadata( $filename, $expected ) {
$file = $this->dataFile( $filename, 'image/png' );
<?php
+/**
+ * @covers SVGMetadataExtractor
+ */
class SVGMetadataExtractorTest extends MediaWikiTestCase {
protected function setUp() {
/**
* @dataProvider provideSvgFiles
*/
- function testGetMetadata( $infile, $expected ) {
+ public function testGetMetadata( $infile, $expected ) {
$this->assertMetadata( $infile, $expected );
}
/**
* @dataProvider provideSvgFilesWithXMLMetadata
*/
- function testGetXMLMetadata( $infile, $expected ) {
+ public function testGetXMLMetadata( $infile, $expected ) {
$r = new XMLReader();
if ( !method_exists( $r, 'readInnerXML' ) ) {
$this->markTestSkipped( 'XMLReader::readInnerXML() does not exist (libxml >2.6.20 needed).' );
<?php
class TiffTest extends MediaWikiTestCase {
+ /** @var TiffHandler */
+ protected $handler;
+ /** @var string */
+ protected $filePath;
+
protected function setUp() {
parent::setUp();
if ( !extension_loaded( 'exif' ) ) {
$this->handler = new TiffHandler;
}
+ /**
+ * @covers TiffHandler::getMetadata
+ */
public function testInvalidFile() {
$res = $this->handler->getMetadata( null, $this->filePath . 'README' );
$this->assertEquals( ExifBitmapHandler::BROKEN_FILE, $res );
}
+ /**
+ * @covers TiffHandler::getMetadata
+ */
public function testTiffMetadataExtraction() {
$res = $this->handler->getMetadata( null, $this->filePath . 'test.tiff' );
$expected = 'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:2;}';
<?php
+
+/**
+ * @todo covers tags
+ */
class XMPTest extends MediaWikiTestCase {
protected function setUp() {
* @param $expected Array expected result of parsing the xmp.
* @param $info String Short sentence on what's being tested.
*
+ * @throws Exception
* @dataProvider provideXMPParse
+ *
+ * @covers XMPReader::parse
*/
public function testXMPParse( $xmp, $expected, $info ) {
if ( !is_string( $xmp ) || !is_array( $expected ) ) {
*
* @todo This is based on what the standard says. Need to find a real
* world example file to double check the support for this is right.
+ *
+ * @covers XMPReader::parseExtended
*/
- function testExtendedXMP() {
+ public function testExtendedXMP() {
$xmpPath = __DIR__ . '/../../data/xmp/';
$standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' );
$extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );
/**
* This test has an extended XMP block with a wrong guid (md5sum)
* and thus should only return the StandardXMP, not the ExtendedXMP.
+ *
+ * @covers XMPReader::parseExtended
*/
- function testExtendedXMPWithWrongGUID() {
+ public function testExtendedXMPWithWrongGUID() {
$xmpPath = __DIR__ . '/../../data/xmp/';
$standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' );
$extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );
/**
* Have a high offset to simulate a missing packet,
* which should cause it to ignore the ExtendedXMP packet.
+ *
+ * @covers XMPReader::parseExtended
*/
- function testExtendedXMPMissingPacket() {
+ public function testExtendedXMPMissingPacket() {
$xmpPath = __DIR__ . '/../../data/xmp/';
$standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' );
$extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' );
/**
* @dataProvider provideDates
+ * @covers XMPValidate::validateDate
*/
- function testValidateDate( $value, $expected ) {
+ public function testValidateDate( $value, $expected ) {
// The method should modify $value.
XMPValidate::validateDate( array(), $value, true );
$this->assertEquals( $expected, $value );
* @ingroup UtfNormal
* @group Large
*
+ * @todo covers tags, will be UtfNormal::cleanUp once the below is resolved
+ * @todo split me into test methods and providers per the below comment
+ *
* We ignore code coverage for this test suite until they are rewritten
* to use data providers (bug 46561).
* @codeCoverageIgnore
*/
class CleanUpTest extends MediaWikiTestCase {
/** @todo document */
- function testAscii() {
+ public function testAscii() {
$text = 'This is plain ASCII text.';
$this->assertEquals( $text, UtfNormal::cleanUp( $text ) );
}
/** @todo document */
- function testNull() {
+ public function testNull() {
$text = "a \x00 null";
$expect = "a \xef\xbf\xbd null";
$this->assertEquals(
}
/** @todo document */
- function testLatin() {
+ public function testLatin() {
$text = "L'\xc3\xa9cole";
$this->assertEquals( $text, UtfNormal::cleanUp( $text ) );
}
/** @todo document */
- function testLatinNormal() {
+ public function testLatinNormal() {
$text = "L'e\xcc\x81cole";
$expect = "L'\xc3\xa9cole";
$this->assertEquals( $expect, UtfNormal::cleanUp( $text ) );
}
/** @todo document */
- function testAllBytes() {
+ public function testAllBytes() {
$this->doTestBytes( '', '' );
$this->doTestBytes( 'x', '' );
$this->doTestBytes( '', 'x' );
}
/** @todo document */
- function testDoubleBytes() {
+ public function testDoubleBytes() {
$this->doTestDoubleBytes( '', '' );
$this->doTestDoubleBytes( 'x', '' );
$this->doTestDoubleBytes( '', 'x' );
}
/** @todo document */
- function testTripleBytes() {
+ public function testTripleBytes() {
$this->doTestTripleBytes( '', '' );
$this->doTestTripleBytes( 'x', '' );
$this->doTestTripleBytes( '', 'x' );
}
/** @todo document */
- function testChunkRegression() {
+ public function testChunkRegression() {
# Check for regression against a chunking bug
$text = "\x46\x55\xb8" .
"\xdc\x96" .
}
/** @todo document */
- function testInterposeRegression() {
+ public function testInterposeRegression() {
$text = "\x4e\x30" .
"\xb1" . # bad tail
"\x3a" .
}
/** @todo document */
- function testOverlongRegression() {
+ public function testOverlongRegression() {
$text = "\x67" .
"\x1a" . # forbidden ascii
"\xea" . # bad head
}
/** @todo document */
- function testSurrogateRegression() {
+ public function testSurrogateRegression() {
$text = "\xed\xb4\x96" . # surrogate 0xDD16
"\x83" . # bad tail
"\xb4" . # bad tail
}
/** @todo document */
- function testBomRegression() {
+ public function testBomRegression() {
$text = "\xef\xbf\xbe" . # U+FFFE, illegal char
"\xb2" . # bad tail
"\xef" . # bad head
}
/** @todo document */
- function testForbiddenRegression() {
+ public function testForbiddenRegression() {
$text = "\xef\xbf\xbf"; # U+FFFF, illegal char
$expect = "\xef\xbf\xbd";
$this->assertEquals(
}
/** @todo document */
- function testHangulRegression() {
+ public function testHangulRegression() {
$text = "\xed\x9c\xaf" . # Hangul char
"\xe1\x87\x81"; # followed by another final jamo
$expect = $text; # Should *not* change.
$out = $parser->getPreloadText( $input, $title, $options );
} else {
$output = $parser->parse( $input, $title, $options, true, true, 1337 );
+ $output->setTOCEnabled( !isset( $opts['notoc'] ) );
$out = $output->getText();
if ( isset( $opts['showtitle'] ) ) {
*
* @group ParserFuzz
*/
- function testFuzzTests() {
+ public function testFuzzTests() {
global $wgParserTestFiles;
$files = $wgParserTestFiles;
* @dataProvider provideHeadings
* @covers Preprocessor_DOM::preprocessToXml
*/
- function testHeadings( $wikiText, $expectedXml ) {
+ public function testHeadings( $wikiText, $expectedXml ) {
$this->assertEquals( $this->normalizeXml( $expectedXml ), $this->preprocessToXml( $wikiText ) );
}
}
/**
* @dataProvider provideValidNames
+ * @covers Parser::setHook
*/
- function testTagHooks( $tag ) {
+ public function testTagHooks( $tag ) {
global $wgParserConf, $wgContLang;
$parser = new Parser( $wgParserConf );
/**
* @dataProvider provideBadNames
* @expectedException MWException
+ * @covers Parser::setHook
*/
- function testBadTagHooks( $tag ) {
+ public function testBadTagHooks( $tag ) {
global $wgParserConf, $wgContLang;
$parser = new Parser( $wgParserConf );
/**
* @dataProvider provideValidNames
+ * @covers Parser::setFunctionTagHook
*/
- function testFunctionTagHooks( $tag ) {
+ public function testFunctionTagHooks( $tag ) {
global $wgParserConf, $wgContLang;
$parser = new Parser( $wgParserConf );
/**
* @dataProvider provideBadNames
* @expectedException MWException
+ * @covers Parser::setFunctionTagHook
*/
- function testBadFunctionTagHooks( $tag ) {
+ public function testBadFunctionTagHooks( $tag ) {
global $wgParserConf, $wgContLang;
$parser = new Parser( $wgParserConf );
/**
* @group Search
* @group Database
+ *
+ * @covers SearchEngine<extended>
+ * @note Coverage will only ever show one of on of the Search* classes
*/
class SearchEngineTest extends MediaWikiLangTestCase {
- protected $search, $pageList;
+ /**
+ * @var SearchEngine
+ */
+ protected $search;
+ protected $pageList;
/**
* Checks for database type & version.
return true;
}
- function testFullWidth() {
+ public function testFullWidth() {
$this->assertEquals(
array( 'FullOneUp', 'FullTwoLow', 'HalfOneUp', 'HalfTwoLow' ),
$this->fetchIds( $this->search->searchText( 'AZ' ) ),
"Search for normalized from Full-width Lower" );
}
- function testTextSearch() {
+ public function testTextSearch() {
$this->assertEquals(
array( 'Smithee' ),
$this->fetchIds( $this->search->searchText( 'smithee' ) ),
"Plain search failed" );
}
- function testTextPowerSearch() {
+ public function testTextPowerSearch() {
$this->search->setNamespaces( array( 0, 1, 4 ) );
$this->assertEquals(
array(
"Power search failed" );
}
- function testTitleSearch() {
+ public function testTitleSearch() {
$this->assertEquals(
array(
'Alan Smithee',
"Title search failed" );
}
- function testTextTitlePowerSearch() {
+ public function testTextTitlePowerSearch() {
$this->search->setNamespaces( array( 0, 1, 4 ) );
$this->assertEquals(
array(
return trim( SearchUpdate::updateText( $text ) );
}
- function testUpdateText() {
+ /**
+ * @covers SearchUpdate::updateText
+ */
+ public function testUpdateText() {
$this->assertEquals(
'test',
$this->updateText( '<div>TeSt</div>' ),
);
}
- function testBug32712() {
+ /**
+ * @covers SearchUpdate::updateText
+ */
+ public function testBug32712() {
$text = "text „http://example.com“ text";
$result = $this->updateText( $text );
$processed = preg_replace( '/Q/u', 'Q', $result );
global $IP;
require_once "$IP/includes/QueryPage.php"; // Needed to populate $wgQueryPages
+/**
+ * @covers QueryPage<extended>
+ */
class QueryAllSpecialPagesTest extends MediaWikiTestCase {
/** List query pages that can not be tested automatically */
* Test SQL for each of our QueryPages objects
* @group Database
*/
- function testQuerypageSqlQuery() {
+ public function testQuerypageSqlQuery() {
global $wgDBtype;
foreach ( $this->queryPages as $page ) {
*
*/
+/**
+ * @covers SpecialPreferences
+ */
class SpecialPreferencesTest extends MediaWikiTestCase {
/**
*
* Test specifications by Alexandre "ialex" Emsenhuber.
*/
- function testBug41337() {
+ public function testBug41337() {
// Set a low limit
$this->setMwGlobals( 'wgMaxSigChars', 2 );
*
* @author Antoine Musso
* @group Database
+ *
+ * @covers SpecialRecentChanges
*/
class SpecialRecentchangesTest extends MediaWikiTestCase {
* @param $expectedProfile An expected search profile name
* @param $expectedNs Array Expected namespaces
*/
- function testProfileAndNamespaceLoading(
+ public function testProfileAndNamespaceLoading(
$requested, $userOptions, $expectedProfile, $expectedNS,
$message = 'Profile name and namespaces mismatches!'
) {
* Verify we do not expand search term in <title> on search result page
* https://gerrit.wikimedia.org/r/4841
*/
- function testSearchTermIsNotExpanded() {
+ public function testSearchTermIsNotExpanded() {
# Initialize [[Special::Search]]
$search = new SpecialSearch();
* @group Broken
* @group Upload
* @group Database
+ *
+ * @covers UploadFromUrl
*/
class UploadFromUrlTest extends ApiTestCase {
protected function setUp() {
/**
* @todo Document why we test login, since the $wgUser hack used doesn't
* require login
+ *
+ * @coversNothing
*/
public function testLogin() {
$data = $this->doApiRequest( array(
<?php
/**
* @group Database
+ *
+ * @covers UploadStash
*/
class UploadStashTest extends MediaWikiTestCase {
/**
* - Emperyan
* @see http://en.wikipedia.org/wiki/Dotted_and_dotless_I
* @dataProvider provideDottedAndDotlessI
+ * @covers Language::ucfirst
+ * @covers Language::lcfirst
*/
public function testDottedAndDotlessI( $func, $input, $inputCase, $expected ) {
if ( $func == 'ucfirst' ) {
* @file
*/
+/**
+ * @covers CLDRPluralRuleEvaluator
+ */
class CLDRPluralRuleEvaluatorTest extends MediaWikiTestCase {
/**
* @dataProvider validTestCases
}
}
+/**
+ * @covers Maintenance
+ */
class MaintenanceTest extends MediaWikiTestCase {
* Tests for BaseDump
*
* @group Dump
+ * @covers BaseDump
*/
class BaseDumpTest extends MediaWikiTestCase {
*
* @group Database
* @group Dump
+ * @covers TextPassDumper
*/
class TextPassDumperTest extends DumpTestCase {
*
* @group Database
* @group Dump
+ * @covers BackupDumper
*/
class BackupDumperLoggerTest extends DumpTestCase {
*
* @group Database
* @group Dump
+ * @covers BackupDumper
*/
class BackupDumperPageTest extends DumpTestCase {
*
* @group Database
* @group Dump
+ * @covers FetchText
*/
class FetchTextTest extends MediaWikiTestCase {
* Tests for getSlaveServer
*
* @group Database
+ * @covers GetSlaveServer
*/
class GetSlaveServerTest extends MediaWikiTestCase {
*/
class SideBarTest extends MediaWikiLangTestCase {
- /** A skin template, reinitialized before each test */
+ /**
+ * A skin template, reinitialized before each test
+ * @var SkinTemplate
+ */
private $skin;
/** Local cache for sidebar messages */
private $messages;
$this->skin->getContext()->setLanguage( Language::factory( 'en' ) );
}
- protected function tearDown() {
- parent::tearDown();
- $this->skin = null;
- }
-
/**
* Internal helper to test the sidebar
* @param $expected
* @param $text
* @param $message (Default: '')
+ * @todo this assert method to should be converted to a test using a dataprovider..
*/
private function assertSideBar( $expected, $text, $message = '' ) {
$bar = array();
$this->assertEquals( $expected, $bar, $message );
}
- function testSidebarWithOnlyTwoTitles() {
+ /**
+ * @covers SkinTemplate::addToSidebarPlain
+ */
+ public function testSidebarWithOnlyTwoTitles() {
$this->assertSideBar(
array(
'Title1' => array(),
);
}
- function testExpandMessages() {
+ /**
+ * @covers SkinTemplate::addToSidebarPlain
+ */
+ public function testExpandMessages() {
$this->assertSidebar(
array( 'Title' => array(
array(
);
}
- function testExternalUrlsRequireADescription() {
+ /**
+ * @covers SkinTemplate::addToSidebarPlain
+ */
+ public function testExternalUrlsRequireADescription() {
$this->assertSidebar(
array( 'Title' => array(
# ** http://www.mediawiki.org/| Home
/**
* bug 33321 - Make sure there's a | after transforming.
* @group Database
+ * @covers SkinTemplate::addToSidebarPlain
*/
- function testTrickyPipe() {
+ public function testTrickyPipe() {
$this->assertSidebar(
array( 'Title' => array(
# The first 2 are skipped
/**
* Simple test to verify our helper assertAttribs() is functional
*/
- function testTestAttributesAssertionHelper() {
+ public function testTestAttributesAssertionHelper() {
$this->setMwGlobals( array(
'wgNoFollowLinks' => true,
'wgExternalLinkTarget' => false,
/**
* Test $wgNoFollowLinks in sidebar
*/
- function testRespectWgnofollowlinks() {
+ public function testRespectWgnofollowlinks() {
$this->setMwGlobals( 'wgNoFollowLinks', false );
$attribs = $this->getAttribs();
* Test $wgExternaLinkTarget in sidebar
* @dataProvider dataRespectExternallinktarget
*/
- function testRespectExternallinktarget( $externalLinkTarget ) {
+ public function testRespectExternallinktarget( $externalLinkTarget ) {
$this->setMwGlobals( 'wgExternalLinkTarget', $externalLinkTarget );
$attribs = $this->getAttribs();
$this->assertEquals( $attribs['target'], $externalLinkTarget );
}
- function dataRespectExternallinktarget() {
+ public static function dataRespectExternallinktarget() {
return array(
array( '_blank' ),
array( '_self' ),