Fixed spacing
- Added/removed spaces around parenthesis - Added space after switch/if/foreach - changed else if to elseif Change-Id: I99cda543e0e077320091addd75c188cb6e3a42c2
This commit is contained in:
parent
a7db326026
commit
2b021dc48a
45 changed files with 74 additions and 75 deletions
|
|
@ -502,7 +502,7 @@ class Html {
|
|||
|
||||
// Remove duplicates and create the string
|
||||
$value = implode( ' ', array_unique( $value ) );
|
||||
} else if ( is_array( $value ) ) {
|
||||
} elseif ( is_array( $value ) ) {
|
||||
throw new MWException( "HTML attribute $key can not contain a list of values" );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class WikiImporter {
|
|||
function __construct( ImportStreamSource $source ) {
|
||||
$this->reader = new XMLReader();
|
||||
|
||||
if ( !in_array( 'uploadsource', stream_get_wrappers() ) ) {
|
||||
if ( !in_array( 'uploadsource', stream_get_wrappers() ) ) {
|
||||
stream_wrapper_register( 'uploadsource', 'UploadSourceAdapter' );
|
||||
}
|
||||
$id = UploadSourceAdapter::registerSource( $source );
|
||||
|
|
|
|||
|
|
@ -979,7 +979,7 @@ class Title {
|
|||
try {
|
||||
$formatter = self::getTitleFormatter();
|
||||
return $formatter->getNamespaceName( $this->mNamespace, $this->mDbkeyform );
|
||||
} catch ( InvalidArgumentException $ex ) {
|
||||
} catch ( InvalidArgumentException $ex ) {
|
||||
wfDebug( __METHOD__ . ': ' . $ex->getMessage() . "\n" );
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ class ApiQuerySiteinfo extends ApiQueryBase {
|
|||
$data['articlepath'] = $config->get( 'ArticlePath' );
|
||||
$data['scriptpath'] = $config->get( 'ScriptPath' );
|
||||
$data['script'] = $config->get( 'Script' );
|
||||
$data['variantarticlepath'] = $config->get( 'VariantArticlePath' );
|
||||
$data['variantarticlepath'] = $config->get( 'VariantArticlePath' );
|
||||
$data['server'] = $config->get( 'Server' );
|
||||
$data['servername'] = $config->get( 'ServerName' );
|
||||
$data['wikiid'] = wfWikiID();
|
||||
|
|
@ -420,7 +420,7 @@ class ApiQuerySiteinfo extends ApiQueryBase {
|
|||
}
|
||||
|
||||
$val['url'] = wfExpandUrl( $row['iw_url'], PROTO_CURRENT );
|
||||
if (substr( $row['iw_url'], 0, 2) == '//') {
|
||||
if ( substr( $row['iw_url'], 0, 2 ) == '//' ) {
|
||||
$val['protorel'] = '';
|
||||
}
|
||||
if ( isset( $row['iw_wikiid'] ) ) {
|
||||
|
|
|
|||
|
|
@ -597,7 +597,7 @@ class ApiResult extends ApiBase {
|
|||
$this->getMain()->getRequest()->getValues(),
|
||||
array_flip( $this->generatorParams )
|
||||
);
|
||||
} else if ( $this->generatorContinuationData ) {
|
||||
} elseif ( $this->generatorContinuationData ) {
|
||||
// All the generator-using modules are complete, but the
|
||||
// generator isn't. Continue the generator and restart the
|
||||
// generator-using modules
|
||||
|
|
|
|||
|
|
@ -827,7 +827,7 @@ __INDEXATTR__;
|
|||
* In Postgres when using FOR UPDATE, only the main table and tables that are inner joined
|
||||
* can be locked. That means tables in an outer join cannot be FOR UPDATE locked. Trying to do
|
||||
* so causes a DB error. This wrapper checks which tables can be locked and adjusts it accordingly.
|
||||
*
|
||||
*
|
||||
* MySQL uses "ORDER BY NULL" as an optimization hint, but that syntax is illegal in PostgreSQL.
|
||||
*/
|
||||
function selectSQLText( $table, $vars, $conds = '', $fname = __METHOD__,
|
||||
|
|
|
|||
|
|
@ -342,9 +342,9 @@ class DatabaseSqlite extends DatabaseBase {
|
|||
*/
|
||||
function numFields( $res ) {
|
||||
$r = $res instanceof ResultWrapper ? $res->result : $res;
|
||||
if ( is_array($r) && count( $r ) > 0 ){
|
||||
if ( is_array( $r ) && count( $r ) > 0 ) {
|
||||
// The size of the result array is twice the number of fields. (Bug: 65578)
|
||||
return count( $r[0] ) / 2 ;
|
||||
return count( $r[0] ) / 2;
|
||||
} else {
|
||||
// If the result is empty return 0
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class HTMLSelectField extends HTMLFormField {
|
|||
|
||||
$allowedParams = array( 'tabindex', 'size' );
|
||||
$customParams = $this->getAttributes( $allowedParams );
|
||||
foreach( $customParams as $name => $value ) {
|
||||
foreach ( $customParams as $name => $value ) {
|
||||
$select->setAttribute( $name, $value );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class MysqlInstaller extends DatabaseInstaller {
|
|||
if ( !strlen( $newValues['_InstallUser'] ) ) {
|
||||
$status->fatal( 'config-db-username-empty' );
|
||||
}
|
||||
if (!strlen( $newValues['_InstallPassword'] ) ) {
|
||||
if ( !strlen( $newValues['_InstallPassword'] ) ) {
|
||||
$status->fatal( 'config-db-password-empty', $newValues['_InstallUser'] );
|
||||
}
|
||||
if ( !$status->isOK() ) {
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class PostgresInstaller extends DatabaseInstaller {
|
|||
function submitConnectForm() {
|
||||
// Get variables from the request
|
||||
$newValues = $this->setVarsFromRequest( array(
|
||||
'wgDBserver', 'wgDBport','wgDBname', 'wgDBmwschema',
|
||||
'wgDBserver', 'wgDBport', 'wgDBname', 'wgDBmwschema',
|
||||
'_InstallUser', '_InstallPassword'
|
||||
) );
|
||||
|
||||
|
|
|
|||
|
|
@ -694,7 +694,7 @@ END;
|
|||
$this->output( "...column '$table.$field' is already of type '$newtype'\n" );
|
||||
} else {
|
||||
$this->output( "Purging data from cache table '$table'\n" );
|
||||
$this->db->query("DELETE from $table" );
|
||||
$this->db->query( "DELETE from $table" );
|
||||
$this->output( "Changing column type of '$table.$field' from '{$fi->type()}' to '$newtype'\n" );
|
||||
$sql = "ALTER TABLE $table ALTER $field TYPE $newtype";
|
||||
if ( strlen( $default ) ) {
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ class XCFHandler extends BitmapHandler {
|
|||
// Try to be consistent with the names used by PNG files.
|
||||
// Unclear from base media type if it has an alpha layer,
|
||||
// so just assume that it does since it "potentially" could.
|
||||
switch( $header['base_type'] ) {
|
||||
switch ( $header['base_type'] ) {
|
||||
case 0:
|
||||
$metadata['colorType'] = 'truecolour-alpha';
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -46,10 +46,10 @@ abstract class BagOStuff {
|
|||
protected $lastError = self::ERR_NONE;
|
||||
|
||||
/** Possible values for getLastError() */
|
||||
const ERR_NONE = 0; // no error
|
||||
const ERR_NONE = 0; // no error
|
||||
const ERR_NO_RESPONSE = 1; // no response
|
||||
const ERR_UNREACHABLE = 2; // can't connect
|
||||
const ERR_UNEXPECTED = 3; // response gave some error
|
||||
const ERR_UNEXPECTED = 3; // response gave some error
|
||||
|
||||
/**
|
||||
* @param bool $bool
|
||||
|
|
|
|||
|
|
@ -363,7 +363,7 @@ class ImagePage extends Article {
|
|||
// it can be denoted as the current size being shown.
|
||||
// Vectorized images are "infinitely" big, so all thumb
|
||||
// sizes are shown.
|
||||
if ( ( ($size[0] <= $width_orig && $size[1] <= $height_orig)
|
||||
if ( ( ( $size[0] <= $width_orig && $size[1] <= $height_orig )
|
||||
|| $this->displayImg->isVectorized() )
|
||||
&& $size[0] != $width && $size[1] != $height
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class PoolCounterRedis extends PoolCounter {
|
|||
|
||||
$this->keySha1 = sha1( $this->key );
|
||||
$met = ini_get( 'max_execution_time' ); // usually 0 in CLI mode
|
||||
$this->lockTTL = $met ? 2*$met : 3600;
|
||||
$this->lockTTL = $met ? 2 * $met : 3600;
|
||||
|
||||
if ( self::$active === null ) {
|
||||
self::$active = array();
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ abstract class Profiler {
|
|||
if ( is_array( $wgProfiler ) ) {
|
||||
if ( !isset( $wgProfiler['class'] ) ) {
|
||||
$class = 'ProfilerStub';
|
||||
} elseif ( $wgProfiler['class'] === 'Profiler' ) {
|
||||
} elseif ( $wgProfiler['class'] === 'Profiler' ) {
|
||||
$class = 'ProfilerStub'; // b/c; don't explode
|
||||
} else {
|
||||
$class = $wgProfiler['class'];
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ class SpecialContributions extends IncludableSpecialPage {
|
|||
$output = $pager->getBody();
|
||||
if ( !$this->including() ) {
|
||||
$output = '<p>' . $pager->getNavigationBar() . '</p>' .
|
||||
$output.
|
||||
$output .
|
||||
'<p>' . $pager->getNavigationBar() . '</p>';
|
||||
}
|
||||
$out->addHTML( $output );
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
|
|||
$talk = $this->msg( 'talkpagelinktext' )->escaped();
|
||||
// Do a batch existence check
|
||||
$batch = new LinkBatch();
|
||||
if (count($titles) >= 100) {
|
||||
if ( count( $titles ) >= 100 ) {
|
||||
$output = wfMessage( 'watchlistedit-too-many' )->parse();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class SpecialPageLanguage extends FormSpecialPage {
|
|||
// Returns the default since the page is not loaded from DB
|
||||
$defLang = $title->getPageLanguage()->getCode();
|
||||
|
||||
$pageId = $title->getArticleID();
|
||||
$pageId = $title->getArticleID();
|
||||
|
||||
// Check if article exists
|
||||
if ( !$pageId ) {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class SpecialTrackingCategories extends SpecialPage {
|
|||
</tr></thead>"
|
||||
);
|
||||
|
||||
foreach( $wgTrackingCategories as $catMsg ) {
|
||||
foreach ( $wgTrackingCategories as $catMsg ) {
|
||||
/*
|
||||
* Check if the tracking category varies by namespace
|
||||
* Otherwise only pages in the current namespace will be displayed
|
||||
|
|
|
|||
|
|
@ -293,7 +293,7 @@ class MWCryptHKDF {
|
|||
for ( $counter = 1; $counter <= $rounds; ++$counter ) {
|
||||
$lastK = hash_hmac(
|
||||
$hash,
|
||||
$lastK . $info . chr($counter),
|
||||
$lastK . $info . chr( $counter ),
|
||||
$prk,
|
||||
true
|
||||
);
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ $magicWords = array(
|
|||
* Date formats list for Special:Preferences
|
||||
* see $dateFormats for definitions
|
||||
*/
|
||||
$datePreferences = array(
|
||||
$datePreferences = array(
|
||||
'ČSN basic dt',
|
||||
'ČSN padded dt',
|
||||
'ČSN basic td',
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ $specialPageAliases = array(
|
|||
'PermanentLink' => array( 'PermanentLink', 'PermaLink' ),
|
||||
'Popularpages' => array( 'PopularPages' ),
|
||||
'Preferences' => array( 'Preferences' ),
|
||||
'Prefixindex' => array( 'PrefixIndex' ) ,
|
||||
'Prefixindex' => array( 'PrefixIndex' ),
|
||||
'Protectedpages' => array( 'ProtectedPages' ),
|
||||
'Protectedtitles' => array( 'ProtectedTitles' ),
|
||||
'Randompage' => array( 'Random', 'RandomPage' ),
|
||||
|
|
|
|||
|
|
@ -106,8 +106,8 @@ $namespaceAliases = array(
|
|||
|
||||
# Aliases to renamed kk-arab namespaces
|
||||
'مەدياۋيكي' => NS_MEDIAWIKI,
|
||||
'مەدياۋيكي_تالقىلاۋى' => NS_MEDIAWIKI_TALK ,
|
||||
'ٷلگٸ' => NS_TEMPLATE ,
|
||||
'مەدياۋيكي_تالقىلاۋى' => NS_MEDIAWIKI_TALK,
|
||||
'ٷلگٸ' => NS_TEMPLATE,
|
||||
'ٷلگٸ_تالقىلاۋى' => NS_TEMPLATE_TALK,
|
||||
'ٴۇلگٴى' => NS_TEMPLATE,
|
||||
'ٴۇلگٴى_تالقىلاۋى' => NS_TEMPLATE_TALK,
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ $namespaceAliases = array(
|
|||
|
||||
# Aliases to renamed kk-arab namespaces
|
||||
'مەدياۋيكي' => NS_MEDIAWIKI,
|
||||
'مەدياۋيكي_تالقىلاۋى' => NS_MEDIAWIKI_TALK ,
|
||||
'ٷلگٸ' => NS_TEMPLATE ,
|
||||
'مەدياۋيكي_تالقىلاۋى' => NS_MEDIAWIKI_TALK,
|
||||
'ٷلگٸ' => NS_TEMPLATE,
|
||||
'ٷلگٸ_تالقىلاۋى' => NS_TEMPLATE_TALK,
|
||||
'ٴۇلگٴى' => NS_TEMPLATE,
|
||||
'ٴۇلگٴى_تالقىلاۋى' => NS_TEMPLATE_TALK,
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ $namespaceAliases = array(
|
|||
|
||||
# Aliases to renamed kk-arab namespaces
|
||||
'مەدياۋيكي' => NS_MEDIAWIKI,
|
||||
'مەدياۋيكي_تالقىلاۋى' => NS_MEDIAWIKI_TALK ,
|
||||
'ٷلگٸ' => NS_TEMPLATE ,
|
||||
'مەدياۋيكي_تالقىلاۋى' => NS_MEDIAWIKI_TALK,
|
||||
'ٷلگٸ' => NS_TEMPLATE,
|
||||
'ٷلگٸ_تالقىلاۋى' => NS_TEMPLATE_TALK,
|
||||
'ٴۇلگٴى' => NS_TEMPLATE,
|
||||
'ٴۇلگٴى_تالقىلاۋى' => NS_TEMPLATE_TALK,
|
||||
|
|
|
|||
|
|
@ -180,5 +180,5 @@ $magicWords = array(
|
|||
);
|
||||
|
||||
$linkTrail = '/^((?:[a-z]|а|æ|б|в|г|д|е|ё|ж|з|и|й|к|л|м|н|о|п|р|с|т|у|ф|х|ц|ч|ш|щ|ъ|ы|ь|э|ю|я|“|»)+)(.*)$/sDu';
|
||||
$fallback8bitEncoding = 'windows-1251';
|
||||
$fallback8bitEncoding = 'windows-1251';
|
||||
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ $magicWords = array(
|
|||
);
|
||||
|
||||
$linkTrail = '/^([a-zåäöéÅÄÖÉ]+)(.*)$/sDu';
|
||||
$separatorTransformTable = array(
|
||||
$separatorTransformTable = array(
|
||||
',' => "\xc2\xa0", // @bug 2749
|
||||
'.' => ','
|
||||
);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class CompareParserCache extends Maintenance {
|
|||
|
||||
$this->output( "Found cache entry found for '{$title->getPrefixedText()}'..." );
|
||||
$oldHtml = trim( preg_replace( '#<!-- .+-->#Us', '', $parserOutputOld->getText() ) );
|
||||
$newHtml = trim( preg_replace( '#<!-- .+-->#Us', '',$parserOutputNew->getText() ) );
|
||||
$newHtml = trim( preg_replace( '#<!-- .+-->#Us', '', $parserOutputNew->getText() ) );
|
||||
$diff = wfDiff( $oldHtml, $newHtml );
|
||||
if ( strlen( $diff ) ) {
|
||||
$this->output( "differences found:\n\n$diff\n\n" );
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ class UcdXmlReader {
|
|||
$xml = $this->open();
|
||||
$this->callback = $callback;
|
||||
|
||||
while ( $xml->name !== 'repertoire' && $xml->next() ) ;
|
||||
while ( $xml->name !== 'repertoire' && $xml->next() );
|
||||
|
||||
while ( $xml->read() ) {
|
||||
if ( $xml->nodeType == XMLReader::ELEMENT ) {
|
||||
|
|
@ -389,7 +389,7 @@ class UcdXmlReader {
|
|||
if ( !$this->xml ) {
|
||||
throw new MWException( __METHOD__ . ": unable to open {$this->fileName}" );
|
||||
}
|
||||
while ( $this->xml->name !== 'ucd' && $this->xml->read() ) ;
|
||||
while ( $this->xml->name !== 'ucd' && $this->xml->read() );
|
||||
$this->xml->read();
|
||||
|
||||
return $this->xml;
|
||||
|
|
@ -450,7 +450,7 @@ class UcdXmlReader {
|
|||
}
|
||||
|
||||
$xml = $this->open();
|
||||
while ( $xml->name !== 'blocks' && $xml->read() ) ;
|
||||
while ( $xml->name !== 'blocks' && $xml->read() );
|
||||
|
||||
while ( $xml->read() ) {
|
||||
if ( $xml->nodeType == XMLReader::ELEMENT ) {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ function wfInstallerMain() {
|
|||
|
||||
if ( !$installer->startSession() ) {
|
||||
|
||||
if( $installer->request->getVal( "css" ) ) {
|
||||
if ( $installer->request->getVal( "css" ) ) {
|
||||
// Do not display errors on css pages
|
||||
$installer->outputCss();
|
||||
exit;
|
||||
|
|
|
|||
|
|
@ -551,7 +551,7 @@ class VectorTemplate extends BaseTemplate {
|
|||
|
||||
<form action="<?php $this->text( 'wgScript' ) ?>" id="searchform">
|
||||
<?php
|
||||
if ($wgVectorUseSimpleSearch) {
|
||||
if ( $wgVectorUseSimpleSearch ) {
|
||||
?>
|
||||
<div id="simpleSearch">
|
||||
<?php
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class WfTimestampTest extends MediaWikiTestCase {
|
|||
if ( substr( $output, 0, 1 ) === '/' ) {
|
||||
// Bug 64946: Day of the week calculations for very old
|
||||
// timestamps varies from system to system.
|
||||
$this->assertRegExp( $output, $timestamp, $message );
|
||||
$this->assertRegExp( $output, $timestamp, $message );
|
||||
} else {
|
||||
$this->assertEquals( $output, $timestamp, $message );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class ImportTest extends MediaWikiLangTestCase {
|
|||
public function testHandlePageContainsRedirect( $xml, $redirectTitle ) {
|
||||
$source = $this->getInputStreamSource( $xml );
|
||||
|
||||
$redirect = NULL;
|
||||
$redirect = null;
|
||||
$callback = function( $title, $origTitle, $revCount, $sRevCount, $pageInfo ) use ( &$redirect ) {
|
||||
if ( array_key_exists( 'redirect', $pageInfo ) ) {
|
||||
$redirect = $pageInfo['redirect'];
|
||||
|
|
@ -92,7 +92,7 @@ EOF
|
|||
</mediawiki>
|
||||
EOF
|
||||
,
|
||||
NULL
|
||||
null
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,8 +215,8 @@ class LinksUpdateTest extends MediaWikiTestCase {
|
|||
$po->setProperty( "bool", true );
|
||||
$expected[] = array( "bool", true );
|
||||
|
||||
$po->setProperty( "float", 4.0 + 1.0/4.0 );
|
||||
$expected[] = array( "float", 4.0 + 1.0/4.0 );
|
||||
$po->setProperty( "float", 4.0 + 1.0 / 4.0 );
|
||||
$expected[] = array( "float", 4.0 + 1.0 / 4.0 );
|
||||
|
||||
$po->setProperty( "int", -7 );
|
||||
$expected[] = array( "int", -7 );
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ mw.loader.implement("test.quux",function($,jQuery){mw.test.baz({token:123});},{"
|
|||
* @dataProvider provideMakeResourceLoaderLink
|
||||
* @covers OutputPage::makeResourceLoaderLink
|
||||
*/
|
||||
public function testMakeResourceLoaderLink( $args, $expectedHtml) {
|
||||
public function testMakeResourceLoaderLink( $args, $expectedHtml ) {
|
||||
$this->setMwGlobals( array(
|
||||
'wgResourceLoaderDebug' => false,
|
||||
'wgResourceLoaderUseESI' => true,
|
||||
|
|
@ -199,19 +199,19 @@ mw.loader.implement("test.quux",function($,jQuery){mw.test.baz({token:123});},{"
|
|||
$out = new OutputPage( $ctx );
|
||||
$rl = $out->getResourceLoader();
|
||||
$rl->register( array(
|
||||
'test.foo' => new ResourceLoaderTestModule(array(
|
||||
'test.foo' => new ResourceLoaderTestModule( array(
|
||||
'script' => 'mw.test.foo( { a: true } );',
|
||||
'styles' => '.mw-test-foo { content: "style"; }',
|
||||
)),
|
||||
'test.bar' => new ResourceLoaderTestModule(array(
|
||||
'test.bar' => new ResourceLoaderTestModule( array(
|
||||
'script' => 'mw.test.bar( { a: true } );',
|
||||
'styles' => '.mw-test-bar { content: "style"; }',
|
||||
)),
|
||||
'test.baz' => new ResourceLoaderTestModule(array(
|
||||
'test.baz' => new ResourceLoaderTestModule( array(
|
||||
'script' => 'mw.test.baz( { a: true } );',
|
||||
'styles' => '.mw-test-baz { content: "style"; }',
|
||||
)),
|
||||
'test.quux' => new ResourceLoaderTestModule(array(
|
||||
'test.quux' => new ResourceLoaderTestModule( array(
|
||||
'script' => 'mw.test.baz( { token: 123 } );',
|
||||
'styles' => '/* pref-animate=off */ .mw-icon { transition: none; }',
|
||||
'group' => 'private',
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class TimeAdjustTest extends MediaWikiLangTestCase {
|
|||
return array(
|
||||
array( '20061231235959', 0, '20061231235959' ),
|
||||
array( '20061231235959', 5, '20070101000459' ),
|
||||
array( '20061231235959', 15,'20070101001459' ),
|
||||
array( '20061231235959', 15, '20070101001459' ),
|
||||
array( '20061231235959', 60, '20070101005959' ),
|
||||
array( '20061231235959', 90, '20070101012959' ),
|
||||
array( '20061231235959', 120, '20070101015959' ),
|
||||
|
|
|
|||
|
|
@ -14,12 +14,12 @@ class ActionTest extends MediaWikiTestCase {
|
|||
parent::setUp();
|
||||
|
||||
$this->setMwGlobals( 'wgActions', array(
|
||||
'null' => null,
|
||||
'dummy' => true,
|
||||
'string' => 'NamedDummyAction',
|
||||
'null' => null,
|
||||
'dummy' => true,
|
||||
'string' => 'NamedDummyAction',
|
||||
'declared' => 'NonExistingClassName',
|
||||
'callable' => array( $this, 'dummyActionCallback' ),
|
||||
'object' => new InstantiatedDummyAction( $this->getPage(), $this->getContext() ),
|
||||
'object' => new InstantiatedDummyAction( $this->getPage(), $this->getContext() ),
|
||||
) );
|
||||
}
|
||||
|
||||
|
|
@ -33,19 +33,19 @@ class ActionTest extends MediaWikiTestCase {
|
|||
|
||||
public function actionProvider() {
|
||||
return array(
|
||||
array( 'dummy', 'DummyAction' ),
|
||||
array( 'string', 'NamedDummyAction' ),
|
||||
array( 'dummy', 'DummyAction' ),
|
||||
array( 'string', 'NamedDummyAction' ),
|
||||
array( 'callable', 'CalledDummyAction' ),
|
||||
array( 'object', 'InstantiatedDummyAction' ),
|
||||
array( 'object', 'InstantiatedDummyAction' ),
|
||||
|
||||
// Capitalization is ignored
|
||||
array( 'STRING', 'NamedDummyAction' ),
|
||||
array( 'STRING', 'NamedDummyAction' ),
|
||||
|
||||
// Null and non-existing values
|
||||
array( 'null', null ),
|
||||
array( 'null', null ),
|
||||
array( 'undeclared', null ),
|
||||
array( '', null ),
|
||||
array( null, null ),
|
||||
array( '', null ),
|
||||
array( null, null ),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ class ConfigFactoryTest extends MediaWikiTestCase {
|
|||
public function testRegister() {
|
||||
$factory = new ConfigFactory();
|
||||
$factory->register( 'unittest', 'GlobalVarConfig::newInstance' );
|
||||
$this->assertTrue( True ); // No exception thrown
|
||||
$this->assertTrue( true ); // No exception thrown
|
||||
$this->setExpectedException( 'InvalidArgumentException' );
|
||||
$factory->register( 'invalid', 'Invalid callback' );
|
||||
}
|
||||
|
|
@ -39,7 +39,7 @@ class ConfigFactoryTest extends MediaWikiTestCase {
|
|||
$factory = new ConfigFactory();
|
||||
$factory->register( 'unittest', function() {
|
||||
return true; // Not a Config object
|
||||
});
|
||||
} );
|
||||
$this->setExpectedException( 'UnexpectedValueException' );
|
||||
$factory->makeConfig( 'unittest' );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -440,12 +440,12 @@ class DatabaseSqliteTest extends MediaWikiTestCase {
|
|||
|
||||
$databaseCreation = $db->query( 'CREATE TABLE a ( a_1 )', __METHOD__ );
|
||||
$this->assertInstanceOf( 'ResultWrapper', $databaseCreation, "Failed to create table a" );
|
||||
$res = $db->select( 'a' , '*');
|
||||
$this->assertEquals( 0, $db->numFields($res), "expects to get 0 fields for an empty table" );
|
||||
$res = $db->select( 'a', '*' );
|
||||
$this->assertEquals( 0, $db->numFields( $res ), "expects to get 0 fields for an empty table" );
|
||||
$insertion = $db->insert( 'a', array( 'a_1' => 10 ), __METHOD__ );
|
||||
$this->assertTrue( $insertion, "Insertion failed" );
|
||||
$res = $db->select( 'a' , '*');
|
||||
$this->assertEquals( 1, $db->numFields($res), "wrong number of fields" );
|
||||
$res = $db->select( 'a', '*' );
|
||||
$this->assertEquals( 1, $db->numFields( $res ), "wrong number of fields" );
|
||||
|
||||
$this->assertTrue( $db->close(), "closing database" );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class MWDebugTest extends MediaWikiTestCase {
|
|||
'gitViewUrl', 'time', 'log', 'debugLog', 'queries', 'request', 'memory',
|
||||
'memoryPeak', 'includes', 'profile', '_element' );
|
||||
|
||||
foreach( $expectedKeys as $expectedKey ) {
|
||||
foreach ( $expectedKeys as $expectedKey ) {
|
||||
$this->assertArrayHasKey( $expectedKey, $data['debuginfo'], "debuginfo has $expectedKey" );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ abstract class MediaWikiMediaTestCase extends MediaWikiTestCase {
|
|||
// Autodetect by file extension for the lazy.
|
||||
$magic = MimeMagic::singleton();
|
||||
$parts = explode( $name, '.' );
|
||||
$type = $magic->guessTypesForExtension( $parts[count( $parts ) - 1] );
|
||||
$type = $magic->guessTypesForExtension( $parts[count( $parts ) - 1] );
|
||||
}
|
||||
return new UnregisteredLocalFile( false, $this->repo,
|
||||
"mwstore://localtesting/data/$name", $type );
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class ParserMethodsTest extends MediaWikiLangTestCase {
|
|||
$wgParser->parse( '<recursivecallparser>baz</recursivecallparser>', $title, $po );
|
||||
}
|
||||
|
||||
public function helperParserFunc( $input, $args, $parser) {
|
||||
public function helperParserFunc( $input, $args, $parser ) {
|
||||
$title = Title::newFromText( 'foo' );
|
||||
$po = new ParserOptions;
|
||||
$parser->parse( $input, $title, $po );
|
||||
|
|
|
|||
|
|
@ -50,10 +50,9 @@ class PoolCounterTest extends MediaWikiTestCase {
|
|||
->disableOriginalConstructor()
|
||||
->getMockForAbstractClass();
|
||||
|
||||
$hashKeyIntoSlots = new ReflectionMethod($poolCounter, 'hashKeyIntoSlots' );
|
||||
$hashKeyIntoSlots = new ReflectionMethod( $poolCounter, 'hashKeyIntoSlots' );
|
||||
$hashKeyIntoSlots->setAccessible( true );
|
||||
|
||||
|
||||
$keysWithTwoSlots = $keysWithFiveSlots = array();
|
||||
foreach ( range( 1, 100 ) as $i ) {
|
||||
$keysWithTwoSlots[] = $hashKeyIntoSlots->invoke( $poolCounter, 'key ' . $i, 2 );
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class PHPUnitMaintClass extends Maintenance {
|
|||
# The below code injects a parameter just like if the user called
|
||||
# Probably fix bug 29226
|
||||
$key = array_search( '--colors', $_SERVER['argv'] );
|
||||
if( $key === false ) {
|
||||
if ( $key === false ) {
|
||||
array_splice( $_SERVER['argv'], 1, 0, '--colors' );
|
||||
}
|
||||
}
|
||||
|
|
@ -115,7 +115,7 @@ class PHPUnitMaintClass extends Maintenance {
|
|||
# PHPUnit uses stream_resolve_include_path() internally
|
||||
# See bug 32022
|
||||
$key = array_search( '--include-path', $_SERVER['argv'] );
|
||||
if( $key === false ) {
|
||||
if ( $key === false ) {
|
||||
array_splice( $_SERVER['argv'], 1, 0,
|
||||
__DIR__
|
||||
. PATH_SEPARATOR
|
||||
|
|
|
|||
Loading…
Reference in a new issue