build: Fix line indents
Fixed SkinModuleTest::provideGetFeatureFilePathsOrder as nesting of arrays for parameters is wrong Change-Id: I9875008adf62d284c48662ebfbd245d72e5be064
This commit is contained in:
parent
c97b33d259
commit
f3524224f0
24 changed files with 211 additions and 206 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// Phan stub for PHP 8.0's WeakMap class
|
||||
|
||||
final class WeakMap implements ArrayAccess, Countable, IteratorAggregate {
|
||||
final class WeakMap implements ArrayAccess, Countable, IteratorAggregate {
|
||||
|
||||
public function count(): int {
|
||||
}
|
||||
|
|
@ -21,4 +21,4 @@
|
|||
|
||||
public function offsetUnset( object $object ): void {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@
|
|||
<exclude name="MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle" />
|
||||
<exclude name="MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage" />
|
||||
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
|
||||
<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact" />
|
||||
<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect" />
|
||||
<exclude name="Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition" />
|
||||
<exclude name="Generic.CodeAnalysis.AssignmentInCondition.Found" />
|
||||
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeClassBrace.BraceNotOnOwnLine" />
|
||||
|
|
|
|||
|
|
@ -2971,10 +2971,10 @@ class RevisionStore implements RevisionFactory, RevisionLookup, LoggerAwareInter
|
|||
if ( !$revId ) {
|
||||
$this->logger->warning(
|
||||
'No latest revision known for page {page} even though it exists with page ID {page_id}', [
|
||||
'page' => $page->__toString(),
|
||||
'page_id' => $pageId,
|
||||
'wiki_id' => $this->getWikiId() ?: 'local',
|
||||
] );
|
||||
'page' => $page->__toString(),
|
||||
'page_id' => $pageId,
|
||||
'wiki_id' => $this->getWikiId() ?: 'local',
|
||||
] );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -447,7 +447,7 @@ class AuthManager implements LoggerAwareInterface {
|
|||
$this->getHookRunner()->onAuthManagerLoginAuthenticateAudit(
|
||||
$ret, $user, $user->getName(), [
|
||||
'performer' => $performer
|
||||
] );
|
||||
] );
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
|
@ -589,7 +589,7 @@ class AuthManager implements LoggerAwareInterface {
|
|||
$this->getHookRunner()->onAuthManagerLoginAuthenticateAudit(
|
||||
$res, null, $guessUserName, [
|
||||
'performer' => $session->getUser()
|
||||
] );
|
||||
] );
|
||||
return $res;
|
||||
case AuthenticationResponse::ABSTAIN:
|
||||
// Continue loop
|
||||
|
|
@ -659,7 +659,7 @@ class AuthManager implements LoggerAwareInterface {
|
|||
$this->getHookRunner()->onAuthManagerLoginAuthenticateAudit(
|
||||
$res, null, $guessUserName, [
|
||||
'performer' => $session->getUser()
|
||||
] );
|
||||
] );
|
||||
return $res;
|
||||
case AuthenticationResponse::REDIRECT:
|
||||
case AuthenticationResponse::UI:
|
||||
|
|
@ -757,7 +757,7 @@ class AuthManager implements LoggerAwareInterface {
|
|||
$this->getHookRunner()->onAuthManagerLoginAuthenticateAudit(
|
||||
$ret, $user, $user->getName(), [
|
||||
'performer' => $session->getUser()
|
||||
] );
|
||||
] );
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
|
@ -793,7 +793,7 @@ class AuthManager implements LoggerAwareInterface {
|
|||
$this->getHookRunner()->onAuthManagerLoginAuthenticateAudit(
|
||||
$res, $user, $user->getName(), [
|
||||
'performer' => $session->getUser()
|
||||
] );
|
||||
] );
|
||||
return $res;
|
||||
case AuthenticationResponse::REDIRECT:
|
||||
case AuthenticationResponse::UI:
|
||||
|
|
@ -841,7 +841,7 @@ class AuthManager implements LoggerAwareInterface {
|
|||
$this->getHookRunner()->onAuthManagerLoginAuthenticateAudit(
|
||||
$ret, $user, $user->getName(), [
|
||||
'performer' => $performer
|
||||
] );
|
||||
] );
|
||||
return $ret;
|
||||
} catch ( \Exception $ex ) {
|
||||
$session->remove( self::AUTHN_STATE );
|
||||
|
|
|
|||
|
|
@ -244,27 +244,29 @@ class WebInstallerOutput {
|
|||
<a href="https://www.mediawiki.org/" title="Main Page"></a>
|
||||
</div>
|
||||
<?php
|
||||
$message = wfMessage( 'config-sidebar' )->plain();
|
||||
// Section 1: External links
|
||||
// @todo FIXME: Migrate to plain link label messages (T227297).
|
||||
foreach ( explode( '----', $message ) as $section ) {
|
||||
echo '<div class="portal"><div class="body">';
|
||||
echo $this->parent->parse( $section, true );
|
||||
echo '</div></div>';
|
||||
}
|
||||
// Section 2: Installer pages
|
||||
echo '<div class="portal"><div class="body"><ul>';
|
||||
foreach ( [
|
||||
'config-sidebar-relnotes' => 'ReleaseNotes',
|
||||
'config-sidebar-license' => 'Copying',
|
||||
'config-sidebar-upgrade' => 'UpgradeDoc',
|
||||
] as $msgKey => $pageName ) {
|
||||
echo $this->parent->makeLinkItem(
|
||||
$this->parent->getDocUrl( $pageName ),
|
||||
wfMessage( $msgKey )->text()
|
||||
);
|
||||
}
|
||||
echo '</ul></div></div>';
|
||||
// @phpcs:disable Generic.WhiteSpace.ScopeIndent.IncorrectExact
|
||||
$message = wfMessage( 'config-sidebar' )->plain();
|
||||
// Section 1: External links
|
||||
// @todo FIXME: Migrate to plain link label messages (T227297).
|
||||
foreach ( explode( '----', $message ) as $section ) {
|
||||
echo '<div class="portal"><div class="body">';
|
||||
echo $this->parent->parse( $section, true );
|
||||
echo '</div></div>';
|
||||
}
|
||||
// Section 2: Installer pages
|
||||
echo '<div class="portal"><div class="body"><ul>';
|
||||
foreach ( [
|
||||
'config-sidebar-relnotes' => 'ReleaseNotes',
|
||||
'config-sidebar-license' => 'Copying',
|
||||
'config-sidebar-upgrade' => 'UpgradeDoc',
|
||||
] as $msgKey => $pageName ) {
|
||||
echo $this->parent->makeLinkItem(
|
||||
$this->parent->getDocUrl( $pageName ),
|
||||
wfMessage( $msgKey )->text()
|
||||
);
|
||||
}
|
||||
echo '</ul></div></div>';
|
||||
// @phpcs:enable
|
||||
?>
|
||||
</aside>
|
||||
|
||||
|
|
|
|||
|
|
@ -2180,9 +2180,9 @@ class WANObjectCache implements
|
|||
// T303092
|
||||
$this->logger->warning(
|
||||
$method . ' failed due to {id} not set in result {result}', [
|
||||
'id' => $id,
|
||||
'result' => json_encode( $result )
|
||||
] );
|
||||
'id' => $id,
|
||||
'result' => json_encode( $result )
|
||||
] );
|
||||
}
|
||||
$newValue = $result[$id];
|
||||
$ttl = $ttls[$id];
|
||||
|
|
|
|||
|
|
@ -492,17 +492,17 @@ class Exif {
|
|||
|
||||
if ( isset( $this->mFilteredExifData['GPSAltitudeRef'] ) ) {
|
||||
switch ( $this->mFilteredExifData['GPSAltitudeRef'] ) {
|
||||
case "\0":
|
||||
// Above sea level
|
||||
break;
|
||||
case "\1":
|
||||
// Below sea level
|
||||
$this->mFilteredExifData['GPSAltitude'] *= -1;
|
||||
break;
|
||||
default:
|
||||
// Invalid
|
||||
unset( $this->mFilteredExifData['GPSAltitude'] );
|
||||
break;
|
||||
case "\0":
|
||||
// Above sea level
|
||||
break;
|
||||
case "\1":
|
||||
// Below sea level
|
||||
$this->mFilteredExifData['GPSAltitude'] *= -1;
|
||||
break;
|
||||
default:
|
||||
// Invalid
|
||||
unset( $this->mFilteredExifData['GPSAltitude'] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -589,7 +589,7 @@ class DeletePage {
|
|||
LoggerFactory::getInstance( 'wfDebug' )->debug(
|
||||
'explicit transaction active in ' . __METHOD__ . ' while deleting {title}', [
|
||||
'title' => $title->getText(),
|
||||
] );
|
||||
] );
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1560,41 +1560,41 @@ class ParserOutput extends CacheTime implements ContentMetadataCollector {
|
|||
*/
|
||||
public function setOutputFlag( string $name, bool $val = true ): void {
|
||||
switch ( $name ) {
|
||||
case ParserOutputFlags::NO_GALLERY:
|
||||
$this->setNoGallery( $val );
|
||||
break;
|
||||
case ParserOutputFlags::NO_GALLERY:
|
||||
$this->setNoGallery( $val );
|
||||
break;
|
||||
|
||||
case ParserOutputFlags::ENABLE_OOUI:
|
||||
$this->setEnableOOUI( $val );
|
||||
break;
|
||||
case ParserOutputFlags::ENABLE_OOUI:
|
||||
$this->setEnableOOUI( $val );
|
||||
break;
|
||||
|
||||
case ParserOutputFlags::NO_INDEX_POLICY:
|
||||
$this->mNoIndexSet = $val;
|
||||
break;
|
||||
case ParserOutputFlags::NO_INDEX_POLICY:
|
||||
$this->mNoIndexSet = $val;
|
||||
break;
|
||||
|
||||
case ParserOutputFlags::INDEX_POLICY:
|
||||
$this->mIndexSet = $val;
|
||||
break;
|
||||
case ParserOutputFlags::INDEX_POLICY:
|
||||
$this->mIndexSet = $val;
|
||||
break;
|
||||
|
||||
case ParserOutputFlags::NEW_SECTION:
|
||||
$this->setNewSection( $val );
|
||||
break;
|
||||
case ParserOutputFlags::NEW_SECTION:
|
||||
$this->setNewSection( $val );
|
||||
break;
|
||||
|
||||
case ParserOutputFlags::HIDE_NEW_SECTION:
|
||||
$this->setHideNewSection( $val );
|
||||
break;
|
||||
case ParserOutputFlags::HIDE_NEW_SECTION:
|
||||
$this->setHideNewSection( $val );
|
||||
break;
|
||||
|
||||
case ParserOutputFlags::PREVENT_CLICKJACKING:
|
||||
$this->setPreventClickjacking( $val );
|
||||
break;
|
||||
case ParserOutputFlags::PREVENT_CLICKJACKING:
|
||||
$this->setPreventClickjacking( $val );
|
||||
break;
|
||||
|
||||
default:
|
||||
if ( $val ) {
|
||||
$this->mFlags[$name] = true;
|
||||
} else {
|
||||
unset( $this->mFlags[$name] );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if ( $val ) {
|
||||
$this->mFlags[$name] = true;
|
||||
} else {
|
||||
unset( $this->mFlags[$name] );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1612,29 +1612,29 @@ class ParserOutput extends CacheTime implements ContentMetadataCollector {
|
|||
*/
|
||||
public function getOutputFlag( string $name ): bool {
|
||||
switch ( $name ) {
|
||||
case ParserOutputFlags::NO_GALLERY:
|
||||
return $this->getNoGallery();
|
||||
case ParserOutputFlags::NO_GALLERY:
|
||||
return $this->getNoGallery();
|
||||
|
||||
case ParserOutputFlags::ENABLE_OOUI:
|
||||
return $this->getEnableOOUI();
|
||||
case ParserOutputFlags::ENABLE_OOUI:
|
||||
return $this->getEnableOOUI();
|
||||
|
||||
case ParserOutputFlags::INDEX_POLICY:
|
||||
return $this->mIndexSet;
|
||||
case ParserOutputFlags::INDEX_POLICY:
|
||||
return $this->mIndexSet;
|
||||
|
||||
case ParserOutputFlags::NO_INDEX_POLICY:
|
||||
return $this->mNoIndexSet;
|
||||
case ParserOutputFlags::NO_INDEX_POLICY:
|
||||
return $this->mNoIndexSet;
|
||||
|
||||
case ParserOutputFlags::NEW_SECTION:
|
||||
return $this->getNewSection();
|
||||
case ParserOutputFlags::NEW_SECTION:
|
||||
return $this->getNewSection();
|
||||
|
||||
case ParserOutputFlags::HIDE_NEW_SECTION:
|
||||
return $this->getHideNewSection();
|
||||
case ParserOutputFlags::HIDE_NEW_SECTION:
|
||||
return $this->getHideNewSection();
|
||||
|
||||
case ParserOutputFlags::PREVENT_CLICKJACKING:
|
||||
return $this->getPreventClickjacking();
|
||||
case ParserOutputFlags::PREVENT_CLICKJACKING:
|
||||
return $this->getPreventClickjacking();
|
||||
|
||||
default:
|
||||
return isset( $this->mFlags[$name] );
|
||||
default:
|
||||
return isset( $this->mFlags[$name] );
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ class BotPasswordSessionProvider extends ImmutableSessionProviderWithCookie {
|
|||
'session' => $info->__toString(),
|
||||
'centralId' => $metadata['centralId'],
|
||||
'appId' => $metadata['appId'],
|
||||
] );
|
||||
] );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -175,7 +175,7 @@ class BotPasswordSessionProvider extends ImmutableSessionProviderWithCookie {
|
|||
'restrictions' => $status->getValue(),
|
||||
'centralId' => $metadata['centralId'],
|
||||
'appId' => $metadata['appId'],
|
||||
] );
|
||||
] );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class CookieSessionProvider extends SessionProvider {
|
|||
'cookie_username' => $userName,
|
||||
'username' => $userInfo->getName(),
|
||||
],
|
||||
] );
|
||||
] );
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -147,7 +147,7 @@ class CookieSessionProvider extends SessionProvider {
|
|||
'session' => $sessionId,
|
||||
'userid' => $userId,
|
||||
'username' => $userInfo->getName(),
|
||||
] );
|
||||
] );
|
||||
return null;
|
||||
}
|
||||
$info['userInfo'] = $userInfo->verified();
|
||||
|
|
@ -169,7 +169,7 @@ class CookieSessionProvider extends SessionProvider {
|
|||
'Session "{session}" requested without UserID cookie',
|
||||
[
|
||||
'session' => $info['id'],
|
||||
] );
|
||||
] );
|
||||
$info['userInfo'] = UserInfo::newAnonymous();
|
||||
} else {
|
||||
// No session ID and no user is the same as an empty session, so
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ class PHPSessionHandler implements SessionHandlerInterface {
|
|||
__METHOD__ . ': Session "{session}" cannot be loaded, skipping write.',
|
||||
[
|
||||
'session' => $id,
|
||||
] );
|
||||
] );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ final class SessionBackend {
|
|||
'SessionBackend "{session}" is unsaved, marking dirty in constructor',
|
||||
[
|
||||
'session' => $this->id->__toString(),
|
||||
] );
|
||||
] );
|
||||
} else {
|
||||
$this->data = $blob['data'];
|
||||
if ( isset( $blob['metadata']['loggedOut'] ) ) {
|
||||
|
|
@ -209,9 +209,9 @@ final class SessionBackend {
|
|||
$this->persistenceChangeType = 'no-expiry';
|
||||
$this->logger->debug(
|
||||
'SessionBackend "{session}" metadata dirty due to missing expiration timestamp',
|
||||
[
|
||||
'session' => $this->id->__toString(),
|
||||
] );
|
||||
[
|
||||
'session' => $this->id->__toString(),
|
||||
] );
|
||||
}
|
||||
}
|
||||
$this->dataHash = md5( serialize( $this->data ) );
|
||||
|
|
@ -292,7 +292,7 @@ final class SessionBackend {
|
|||
[
|
||||
'session' => $this->id->__toString(),
|
||||
'oldId' => $oldId,
|
||||
] );
|
||||
] );
|
||||
|
||||
if ( $restart ) {
|
||||
session_id( (string)$this->id );
|
||||
|
|
@ -342,7 +342,7 @@ final class SessionBackend {
|
|||
'SessionBackend "{session}" force-persist due to persist()',
|
||||
[
|
||||
'session' => $this->id->__toString(),
|
||||
] );
|
||||
] );
|
||||
$this->autosave();
|
||||
} else {
|
||||
$this->renew();
|
||||
|
|
@ -400,7 +400,7 @@ final class SessionBackend {
|
|||
'SessionBackend "{session}" metadata dirty due to remember-user change',
|
||||
[
|
||||
'session' => $this->id->__toString(),
|
||||
] );
|
||||
] );
|
||||
$this->autosave();
|
||||
}
|
||||
}
|
||||
|
|
@ -470,7 +470,7 @@ final class SessionBackend {
|
|||
'SessionBackend "{session}" metadata dirty due to user change',
|
||||
[
|
||||
'session' => $this->id->__toString(),
|
||||
] );
|
||||
] );
|
||||
$this->autosave();
|
||||
}
|
||||
|
||||
|
|
@ -506,7 +506,7 @@ final class SessionBackend {
|
|||
'SessionBackend "{session}" metadata dirty due to force-HTTPS change',
|
||||
[
|
||||
'session' => $this->id->__toString(),
|
||||
] );
|
||||
] );
|
||||
$this->autosave();
|
||||
}
|
||||
}
|
||||
|
|
@ -531,7 +531,7 @@ final class SessionBackend {
|
|||
'SessionBackend "{session}" metadata dirty due to logged-out-timestamp change',
|
||||
[
|
||||
'session' => $this->id->__toString(),
|
||||
] );
|
||||
] );
|
||||
$this->autosave();
|
||||
}
|
||||
}
|
||||
|
|
@ -560,7 +560,7 @@ final class SessionBackend {
|
|||
'SessionBackend "{session}" metadata dirty due to provider metadata change',
|
||||
[
|
||||
'session' => $this->id->__toString(),
|
||||
] );
|
||||
] );
|
||||
$this->autosave();
|
||||
}
|
||||
}
|
||||
|
|
@ -596,7 +596,7 @@ final class SessionBackend {
|
|||
[
|
||||
'session' => $this->id->__toString(),
|
||||
'callers' => wfGetAllCallers( 5 ),
|
||||
] );
|
||||
] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -612,7 +612,7 @@ final class SessionBackend {
|
|||
[
|
||||
'session' => $this->id->__toString(),
|
||||
'callers' => wfGetAllCallers( 5 ),
|
||||
] );
|
||||
] );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -629,7 +629,7 @@ final class SessionBackend {
|
|||
[
|
||||
'session' => $this->id->__toString(),
|
||||
'callers' => wfGetAllCallers( 5 ),
|
||||
] );
|
||||
] );
|
||||
if ( $this->persist ) {
|
||||
$this->persistenceChangeType = 'renew';
|
||||
$this->forcePersist = true;
|
||||
|
|
@ -638,7 +638,7 @@ final class SessionBackend {
|
|||
[
|
||||
'session' => $this->id->__toString(),
|
||||
'callers' => wfGetAllCallers( 5 ),
|
||||
] );
|
||||
] );
|
||||
}
|
||||
}
|
||||
$this->autosave();
|
||||
|
|
@ -690,7 +690,7 @@ final class SessionBackend {
|
|||
[
|
||||
'session' => $this->id->__toString(),
|
||||
'user' => $this->user->__toString(),
|
||||
] );
|
||||
] );
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -707,7 +707,7 @@ final class SessionBackend {
|
|||
[
|
||||
'session' => $this->id->__toString(),
|
||||
'user' => $this->user->__toString(),
|
||||
] );
|
||||
] );
|
||||
$this->user->setToken();
|
||||
if ( !MediaWikiServices::getInstance()->getReadOnlyMode()->isReadOnly() ) {
|
||||
// Promise that the token set here will be valid; save it at end of request
|
||||
|
|
@ -729,7 +729,7 @@ final class SessionBackend {
|
|||
'session' => $this->id->__toString(),
|
||||
'expected' => $this->dataHash,
|
||||
'got' => md5( serialize( $this->data ) ),
|
||||
] );
|
||||
] );
|
||||
$this->dataDirty = true;
|
||||
}
|
||||
|
||||
|
|
@ -745,7 +745,7 @@ final class SessionBackend {
|
|||
'dataDirty' => (int)$this->dataDirty,
|
||||
'metaDirty' => (int)$this->metaDirty,
|
||||
'forcePersist' => (int)$this->forcePersist,
|
||||
] );
|
||||
] );
|
||||
|
||||
// Persist or unpersist to the provider, if necessary
|
||||
if ( $this->metaDirty || $this->forcePersist ) {
|
||||
|
|
@ -833,7 +833,7 @@ final class SessionBackend {
|
|||
'SessionBackend "{session}" Taking over PHP session',
|
||||
[
|
||||
'session' => $this->id->__toString(),
|
||||
] );
|
||||
] );
|
||||
session_id( (string)$this->id );
|
||||
AtEase::quietCall( 'session_start' );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,10 +135,10 @@ class SpecialExport extends SpecialPage {
|
|||
// If not, we could deprecate them and do some cleanup, here and in WikiExporter.
|
||||
LoggerFactory::getInstance( 'export' )->debug(
|
||||
'Special:Export POST, dir: [{dir}], offset: [{offset}], limit: [{limit}]', [
|
||||
'dir' => $request->getRawVal( 'dir' ),
|
||||
'offset' => $request->getRawVal( 'offset' ),
|
||||
'limit' => $request->getRawVal( 'limit' ),
|
||||
] );
|
||||
'dir' => $request->getRawVal( 'dir' ),
|
||||
'offset' => $request->getRawVal( 'offset' ),
|
||||
'limit' => $request->getRawVal( 'limit' ),
|
||||
] );
|
||||
|
||||
$page = $request->getText( 'pages' );
|
||||
$this->curonly = $request->getCheck( 'curonly' );
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ class SpecialJavaScriptTest extends SpecialPage {
|
|||
} );
|
||||
} );
|
||||
JAVASCRIPT
|
||||
);
|
||||
);
|
||||
|
||||
header( 'Content-Type: text/javascript; charset=utf-8' );
|
||||
header( 'Cache-Control: private, no-cache, must-revalidate' );
|
||||
|
|
|
|||
|
|
@ -293,7 +293,7 @@ class LinkFilterTest extends MediaWikiLangTestCase {
|
|||
'mailto:',
|
||||
'//',
|
||||
'file://', # Non-default
|
||||
] );
|
||||
] );
|
||||
|
||||
$index = LinkFilter::makeIndexes( $url );
|
||||
$this->assertEquals( $expected, $index, "LinkFilter::makeIndexes(\"$url\")" );
|
||||
|
|
@ -390,7 +390,7 @@ class LinkFilterTest extends MediaWikiLangTestCase {
|
|||
'mailto:',
|
||||
'//',
|
||||
'file://', # Non-default
|
||||
] );
|
||||
] );
|
||||
|
||||
$index = LinkFilter::reverseIndexes( $url );
|
||||
$this->assertEquals( $expected, $index, "LinkFilter::reverseIndexe(\"$url\")" );
|
||||
|
|
|
|||
|
|
@ -1265,7 +1265,7 @@ mw.foo()
|
|||
mw.foo()
|
||||
mw.loader.state({"test1":"ready","test2":"ready"});
|
||||
JS
|
||||
);
|
||||
);
|
||||
$rl->respond( $context );
|
||||
|
||||
$extraHeaders = TestingAccessWrapper::newFromObject( $rl )->extraHeaders;
|
||||
|
|
|
|||
|
|
@ -535,69 +535,69 @@ class SkinModuleTest extends ResourceLoaderTestCase {
|
|||
|
||||
public static function provideGetFeatureFilePathsOrder() {
|
||||
return [
|
||||
[
|
||||
'The "logo" skin-feature is loaded when the "features" key is absent',
|
||||
[],
|
||||
[
|
||||
'The "logo" skin-feature is loaded when the "features" key is absent',
|
||||
[],
|
||||
[
|
||||
'all' => [ self::getSkinFeaturePath( 'logo', 'all' ) ],
|
||||
'print' => [ self::getSkinFeaturePath( 'logo', 'print' ) ],
|
||||
],
|
||||
'all' => [ self::getSkinFeaturePath( 'logo', 'all' ) ],
|
||||
'print' => [ self::getSkinFeaturePath( 'logo', 'print' ) ],
|
||||
],
|
||||
],
|
||||
[
|
||||
'The "normalize" skin-feature is always output first',
|
||||
[
|
||||
'features' => [ 'elements', 'normalize' ],
|
||||
],
|
||||
[
|
||||
'The "normalize" skin-feature is always output first',
|
||||
[
|
||||
'features' => [ 'elements', 'normalize' ],
|
||||
],
|
||||
[
|
||||
'all' => [ self::getSkinFeaturePath( 'normalize', 'all' ) ],
|
||||
'screen' => [ self::getSkinFeaturePath( 'elements', 'screen' ) ],
|
||||
'print' => [ self::getSkinFeaturePath( 'elements', 'print' ) ],
|
||||
],
|
||||
'all' => [ self::getSkinFeaturePath( 'normalize', 'all' ) ],
|
||||
'screen' => [ self::getSkinFeaturePath( 'elements', 'screen' ) ],
|
||||
'print' => [ self::getSkinFeaturePath( 'elements', 'print' ) ],
|
||||
],
|
||||
],
|
||||
[
|
||||
'Empty media query blocks are not included in output',
|
||||
[
|
||||
'Empty media query blocks are not included in output',
|
||||
[
|
||||
'features' => [
|
||||
'accessibility' => false,
|
||||
'content-body' => false,
|
||||
'interface-core' => false,
|
||||
'toc' => false
|
||||
],
|
||||
],
|
||||
[
|
||||
'' => [ '' ],
|
||||
'features' => [
|
||||
'accessibility' => false,
|
||||
'content-body' => false,
|
||||
'interface-core' => false,
|
||||
'toc' => false
|
||||
],
|
||||
],
|
||||
[ 'Empty "features" key outputs default skin-features',
|
||||
[
|
||||
'features' => [],
|
||||
],
|
||||
[
|
||||
'all' => [
|
||||
self::getSkinFeaturePath( 'accessibility', 'all' ),
|
||||
self::getSkinFeaturePath( 'toc', 'all' )
|
||||
],
|
||||
'screen' => [
|
||||
self::getSkinFeaturePath( 'content-body', 'screen' ),
|
||||
self::getSkinFeaturePath( 'interface-core', 'screen' ),
|
||||
self::getSkinFeaturePath( 'toc', 'screen' ),
|
||||
],
|
||||
'print' => [
|
||||
self::getSkinFeaturePath( 'content-body', 'print' ),
|
||||
self::getSkinFeaturePath( 'interface-core', 'print' ),
|
||||
self::getSkinFeaturePath( 'toc', 'print' )
|
||||
]
|
||||
],
|
||||
[],
|
||||
],
|
||||
[
|
||||
'Empty "features" key outputs default skin-features',
|
||||
[
|
||||
'features' => [],
|
||||
],
|
||||
[ 'skin-features are output in the order defined in SkinModule.php',
|
||||
[
|
||||
'features' => [ 'interface-message-box', 'normalize', 'accessibility' ],
|
||||
[
|
||||
'all' => [
|
||||
self::getSkinFeaturePath( 'accessibility', 'all' ),
|
||||
self::getSkinFeaturePath( 'toc', 'all' )
|
||||
],
|
||||
[
|
||||
'all' => [
|
||||
self::getSkinFeaturePath( 'accessibility', 'all' ),
|
||||
self::getSkinFeaturePath( 'normalize', 'all' ),
|
||||
self::getSkinFeaturePath( 'interface-message-box', 'all' )
|
||||
],
|
||||
'screen' => [
|
||||
self::getSkinFeaturePath( 'content-body', 'screen' ),
|
||||
self::getSkinFeaturePath( 'interface-core', 'screen' ),
|
||||
self::getSkinFeaturePath( 'toc', 'screen' ),
|
||||
],
|
||||
'print' => [
|
||||
self::getSkinFeaturePath( 'content-body', 'print' ),
|
||||
self::getSkinFeaturePath( 'interface-core', 'print' ),
|
||||
self::getSkinFeaturePath( 'toc', 'print' )
|
||||
]
|
||||
],
|
||||
],
|
||||
[
|
||||
'skin-features are output in the order defined in SkinModule.php',
|
||||
[
|
||||
'features' => [ 'interface-message-box', 'normalize', 'accessibility' ],
|
||||
],
|
||||
[
|
||||
'all' => [
|
||||
self::getSkinFeaturePath( 'accessibility', 'all' ),
|
||||
self::getSkinFeaturePath( 'normalize', 'all' ),
|
||||
self::getSkinFeaturePath( 'interface-message-box', 'all' )
|
||||
],
|
||||
]
|
||||
]
|
||||
|
|
|
|||
|
|
@ -358,16 +358,19 @@ class DefaultPreferencesFactoryTest extends \MediaWikiIntegrationTestCase {
|
|||
->willReturn( $this->context );
|
||||
|
||||
$this->setTemporaryHook( 'PreferencesFormPreSave',
|
||||
function ( $formData, $form, $user, &$result, $oldUserOptions )
|
||||
use ( $newOptions, $oldOptions, $userMock ) {
|
||||
$this->assertSame( $userMock, $user );
|
||||
foreach ( $newOptions as $option => $value ) {
|
||||
$this->assertSame( $value, $formData[ $option ] );
|
||||
}
|
||||
foreach ( $oldOptions as $option => $value ) {
|
||||
$this->assertSame( $value, $oldUserOptions[ $option ] );
|
||||
}
|
||||
$this->assertTrue( $result );
|
||||
function (
|
||||
$formData, $form, $user, &$result, $oldUserOptions
|
||||
) use (
|
||||
$newOptions, $oldOptions, $userMock
|
||||
) {
|
||||
$this->assertSame( $userMock, $user );
|
||||
foreach ( $newOptions as $option => $value ) {
|
||||
$this->assertSame( $value, $formData[ $option ] );
|
||||
}
|
||||
foreach ( $oldOptions as $option => $value ) {
|
||||
$this->assertSame( $value, $oldUserOptions[ $option ] );
|
||||
}
|
||||
$this->assertTrue( $result );
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class SpecialContributionsTest extends SpecialPageTestBase {
|
|||
new FauxRequest( [
|
||||
'year' => $year,
|
||||
'month' => $month,
|
||||
] ) );
|
||||
] ) );
|
||||
if ( $expect ) {
|
||||
$this->assertStringContainsString( $this->pageName, $html );
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -149,11 +149,11 @@ class SpecialSearchTest extends MediaWikiIntegrationTestCase {
|
|||
],
|
||||
[
|
||||
$EMPTY_REQUEST, [
|
||||
'searchNs2' => 1,
|
||||
'searchNs14' => 1,
|
||||
] + array_fill_keys( array_map( static function ( $ns ) {
|
||||
return "searchNs$ns";
|
||||
}, $defaultNS ), 0 ),
|
||||
'searchNs2' => 1,
|
||||
'searchNs14' => 1,
|
||||
] + array_fill_keys( array_map( static function ( $ns ) {
|
||||
return "searchNs$ns";
|
||||
}, $defaultNS ), 0 ),
|
||||
'advanced', [ 2, 14 ],
|
||||
'T35583: search with no option should honor User search preferences'
|
||||
. ' and have all other namespace disabled'
|
||||
|
|
|
|||
|
|
@ -394,7 +394,7 @@ class UpdateHandlerTest extends MediaWikiLangTestCase {
|
|||
"title" => "Foo",
|
||||
"contentmodel" => "wikitext",
|
||||
"nochange" => "", // null-edit!
|
||||
]
|
||||
]
|
||||
],
|
||||
[ // Response expected to be generated by UpdateHandler
|
||||
'id' => 94542,
|
||||
|
|
|
|||
|
|
@ -398,7 +398,7 @@ class RouterTest extends MediaWikiUnitTestCase {
|
|||
$this->assertSame( 415, $response->getStatusCode() );
|
||||
}
|
||||
|
||||
public function testDeleteRequestWithoutBody() {
|
||||
public function testDeleteRequestWithoutBody() {
|
||||
// Test DELETE request without body
|
||||
$requestWithoutBody = new RequestData( [
|
||||
'uri' => new Uri( '/rest/mock/RouterTest/echo' ),
|
||||
|
|
@ -407,7 +407,7 @@ class RouterTest extends MediaWikiUnitTestCase {
|
|||
$router = $this->createRouter( $requestWithoutBody );
|
||||
$responseWithoutBody = $router->execute( $requestWithoutBody );
|
||||
$this->assertSame( 200, $responseWithoutBody->getStatusCode() );
|
||||
}
|
||||
}
|
||||
|
||||
public function testDeleteRequestWithBody() {
|
||||
// Test DELETE request with body
|
||||
|
|
|
|||
|
|
@ -35,12 +35,14 @@ class EnumDefTest extends TypeDefTestCase {
|
|||
] ],
|
||||
'Deprecated with message' => [
|
||||
'b', 'b', $settings, [], [
|
||||
[ 'code' => 'deprecated-value', 'data' => null ]
|
||||
] ],
|
||||
[ 'code' => 'deprecated-value', 'data' => null ]
|
||||
]
|
||||
],
|
||||
'Deprecated with data message' => [
|
||||
'e', 'e', $settings, [], [
|
||||
[ 'code' => 'deprecated-value', 'data' => [ 'x' => 'y' ] ]
|
||||
] ],
|
||||
[ 'code' => 'deprecated-value', 'data' => [ 'x' => 'y' ] ]
|
||||
]
|
||||
],
|
||||
'Deprecated, from default' => [
|
||||
'c', 'c', $settings, [ 'is-default' => true ], []
|
||||
],
|
||||
|
|
|
|||
Loading…
Reference in a new issue