Amire80 has uploaded a new change for review.
https://gerrit.wikimedia.org/r/243386
Change subject: Fix Generic.Files.LineLength phpcs check in 11 files under
tests/phpunit/includes/
......................................................................
Fix Generic.Files.LineLength phpcs check in 11 files under
tests/phpunit/includes/
Bug: T102614
Change-Id: Iee3df5f064f595ecebe8210cc936bc3d20a122c9
---
M tests/phpunit/includes/ImportTest.php
M tests/phpunit/includes/LinkerTest.php
M tests/phpunit/includes/TestUser.php
M tests/phpunit/includes/changes/TestRecentChangesHelper.php
M tests/phpunit/includes/logging/LogFormatterTest.php
M tests/phpunit/includes/logging/ProtectLogFormatterTest.php
M tests/phpunit/includes/mail/MailAddressTest.php
M tests/phpunit/includes/media/WebPTest.php
M tests/phpunit/includes/registration/ExtensionProcessorTest.php
M tests/phpunit/includes/upload/UploadBaseTest.php
10 files changed, 60 insertions(+), 19 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/86/243386/1
diff --git a/tests/phpunit/includes/ImportTest.php
b/tests/phpunit/includes/ImportTest.php
index 7ef44e7..8ee2ad5 100644
--- a/tests/phpunit/includes/ImportTest.php
+++ b/tests/phpunit/includes/ImportTest.php
@@ -38,7 +38,10 @@
}
};
- $importer = new WikiImporter( $source,
ConfigFactory::getDefaultInstance()->makeConfig( 'main' ) );
+ $importer = new WikiImporter(
+ $source,
+ ConfigFactory::getDefaultInstance()->makeConfig( 'main'
)
+ );
$importer->setPageOutCallback( $callback );
$importer->doImport();
@@ -46,6 +49,7 @@
}
public function getRedirectXML() {
+ // @codingStandardsIgnoreStart Generic.Files.LineLength
return array(
array(
<<< EOF
@@ -100,6 +104,7 @@
null
),
);
+ // @codingStandardsIgnoreEnd
}
/**
@@ -116,7 +121,10 @@
$importNamespaces = $siteinfo['_namespaces'];
};
- $importer = new WikiImporter( $source,
ConfigFactory::getDefaultInstance()->makeConfig( 'main' ) );
+ $importer = new WikiImporter(
+ $source,
+ ConfigFactory::getDefaultInstance()->makeConfig( 'main'
)
+ );
$importer->setSiteInfoCallback( $callback );
$importer->doImport();
@@ -124,6 +132,7 @@
}
public function getSiteInfoXML() {
+ // @codingStandardsIgnoreStart Generic.Files.LineLength
return array(
array(
<<< EOF
@@ -155,6 +164,7 @@
)
),
);
+ // @codingStandardsIgnoreEnd
}
}
diff --git a/tests/phpunit/includes/LinkerTest.php
b/tests/phpunit/includes/LinkerTest.php
index 19ab56f..b8b5a77 100644
--- a/tests/phpunit/includes/LinkerTest.php
+++ b/tests/phpunit/includes/LinkerTest.php
@@ -131,6 +131,7 @@
public function provideCasesForFormatComment() {
$wikiId = 'enwiki'; // $wgConf has a fake entry for this
+ // @codingStandardsIgnoreStart Generic.Files.LineLength
return array(
// Linker::formatComment
array(
@@ -254,6 +255,7 @@
false, false, $wikiId
)
);
+ // @codingStandardsIgnoreEnd
}
/**
diff --git a/tests/phpunit/includes/TestUser.php
b/tests/phpunit/includes/TestUser.php
index 754568d..96b2251 100644
--- a/tests/phpunit/includes/TestUser.php
+++ b/tests/phpunit/includes/TestUser.php
@@ -28,7 +28,9 @@
private function assertNotReal() {
global $wgDBprefix;
- if ( $wgDBprefix !== MediaWikiTestCase::DB_PREFIX &&
$wgDBprefix !== MediaWikiTestCase::ORA_DB_PREFIX ) {
+ if ( $wgDBprefix !== MediaWikiTestCase::DB_PREFIX &&
+ $wgDBprefix !== MediaWikiTestCase::ORA_DB_PREFIX
+ ) {
throw new MWException( "Can't create user on real
database" );
}
}
diff --git a/tests/phpunit/includes/changes/TestRecentChangesHelper.php
b/tests/phpunit/includes/changes/TestRecentChangesHelper.php
index 2506087..fe5bdd2 100644
--- a/tests/phpunit/includes/changes/TestRecentChangesHelper.php
+++ b/tests/phpunit/includes/changes/TestRecentChangesHelper.php
@@ -25,8 +25,8 @@
return $this->makeRecentChange( $attribs, $counter,
$watchingUsers );
}
- public function makeLogRecentChange( $logType, $logAction, User $user,
$titleText, $timestamp, $counter,
- $watchingUsers
+ public function makeLogRecentChange(
+ $logType, $logAction, User $user, $titleText, $timestamp,
$counter, $watchingUsers
) {
$attribs = array_merge(
$this->getDefaultAttributes( $titleText, $timestamp ),
diff --git a/tests/phpunit/includes/logging/LogFormatterTest.php
b/tests/phpunit/includes/logging/LogFormatterTest.php
index 1816708..478086b 100644
--- a/tests/phpunit/includes/logging/LogFormatterTest.php
+++ b/tests/phpunit/includes/logging/LogFormatterTest.php
@@ -523,8 +523,10 @@
# protect/modify
$this->assertIRCComment(
- $this->context->msg( 'modifiedarticleprotection',
'SomeTitle ' . $protectParams['4::description'] )
- ->plain() . $sep . $this->user_comment,
+ $this->context->msg(
+ 'modifiedarticleprotection',
+ 'SomeTitle ' . $protectParams['4::description']
+ )->plain() . $sep . $this->user_comment,
'protect', 'modify',
$protectParams,
$this->user_comment
diff --git a/tests/phpunit/includes/logging/ProtectLogFormatterTest.php
b/tests/phpunit/includes/logging/ProtectLogFormatterTest.php
index 718c08c..558c0fd 100644
--- a/tests/phpunit/includes/logging/ProtectLogFormatterTest.php
+++ b/tests/phpunit/includes/logging/ProtectLogFormatterTest.php
@@ -37,7 +37,8 @@
),
),
array(
- 'text' => 'User protected ProtectPage
[Edit=Allow only administrators] (indefinite) [Move=Allow only administrators]
(indefinite)',
+ 'text' => 'User protected ProtectPage
[Edit=Allow only administrators] ' .
+ '(indefinite) [Move=Allow only
administrators] (indefinite)',
'api' => array(
'description' => '[edit=sysop]
(indefinite)[move=sysop] (indefinite)',
'cascade' => false,
@@ -87,7 +88,8 @@
),
),
array(
- 'text' => 'User protected ProtectPage
[Edit=Allow only administrators] (indefinite) [Move=Allow only administrators]
(indefinite) [cascading]',
+ 'text' => 'User protected ProtectPage
[Edit=Allow only administrators] ' .
+ '(indefinite) [Move=Allow only
administrators] (indefinite) [cascading]',
'api' => array(
'description' => '[edit=sysop]
(indefinite)[move=sysop] (indefinite)',
'cascade' => true,
@@ -147,7 +149,8 @@
),
array(
'legacy' => true,
- 'text' => 'User protected ProtectPage
[edit=sysop] (indefinite)[move=sysop] (indefinite) [cascading]',
+ 'text' => 'User protected ProtectPage
[edit=sysop] ' .
+ '(indefinite)[move=sysop]
(indefinite) [cascading]',
'api' => array(
'description' => '[edit=sysop]
(indefinite)[move=sysop] (indefinite)',
'cascade' => true,
@@ -200,7 +203,9 @@
),
),
array(
- 'text' => 'User changed protection
level for ProtectPage [Edit=Allow only administrators] (indefinite) [Move=Allow
only administrators] (indefinite)',
+ 'text' => 'User changed protection
level for ProtectPage ' .
+ '[Edit=Allow only
administrators] ' .
+ '(indefinite) [Move=Allow only
administrators] (indefinite)',
'api' => array(
'description' => '[edit=sysop]
(indefinite)[move=sysop] (indefinite)',
'cascade' => false,
@@ -287,7 +292,8 @@
),
array(
'legacy' => true,
- 'text' => 'User changed protection
level for ProtectPage [edit=sysop] (indefinite)[move=sysop] (indefinite)',
+ 'text' => 'User changed protection
level for ProtectPage ' .
+ '[edit=sysop]
(indefinite)[move=sysop] (indefinite)',
'api' => array(
'description' => '[edit=sysop]
(indefinite)[move=sysop] (indefinite)',
'cascade' => false,
@@ -310,7 +316,8 @@
),
array(
'legacy' => true,
- 'text' => 'User changed protection
level for ProtectPage [edit=sysop] (indefinite)[move=sysop] (indefinite)
[cascading]',
+ 'text' => 'User changed protection
level for ProtectPage ' .
+ '[edit=sysop]
(indefinite)[move=sysop] (indefinite) [cascading]',
'api' => array(
'description' => '[edit=sysop]
(indefinite)[move=sysop] (indefinite)',
'cascade' => true,
diff --git a/tests/phpunit/includes/mail/MailAddressTest.php
b/tests/phpunit/includes/mail/MailAddressTest.php
index 18d2acd..1fc63d9 100644
--- a/tests/phpunit/includes/mail/MailAddressTest.php
+++ b/tests/phpunit/includes/mail/MailAddressTest.php
@@ -18,9 +18,15 @@
$this->markTestSkipped( 'This test only works on
non-Windows platforms' );
}
$user = $this->getMock( 'User' );
- $user->expects( $this->any() )->method( 'getName' )->will(
$this->returnValue( 'UserName' ) );
- $user->expects( $this->any() )->method( 'getEmail' )->will(
$this->returnValue( '[email protected]' ) );
- $user->expects( $this->any() )->method( 'getRealName' )->will(
$this->returnValue( 'Real name' ) );
+ $user->expects( $this->any() )->method( 'getName' )->will(
+ $this->returnValue( 'UserName' )
+ );
+ $user->expects( $this->any() )->method( 'getEmail' )->will(
+ $this->returnValue( '[email protected]' )
+ );
+ $user->expects( $this->any() )->method( 'getRealName' )->will(
+ $this->returnValue( 'Real name' )
+ );
$ma = MailAddress::newFromUser( $user );
$this->assertInstanceOf( 'MailAddress', $ma );
diff --git a/tests/phpunit/includes/media/WebPTest.php
b/tests/phpunit/includes/media/WebPTest.php
index 285f280..b6d4114 100644
--- a/tests/phpunit/includes/media/WebPTest.php
+++ b/tests/phpunit/includes/media/WebPTest.php
@@ -19,6 +19,7 @@
$this->assertEquals( $expectedResult,
WebPHandler::extractMetadata( $this->tempFileName ) );
}
public function provideTestExtractMetaData() {
+ // @codingStandardsIgnoreStart Generic.Files.LineLength
return array(
// Files from
https://developers.google.com/speed/webp/gallery2
array(
"\x52\x49\x46\x46\x90\x68\x01\x00\x57\x45\x42\x50\x56\x50\x38\x4C\x83\x68\x01\x00\x2F\x8F\x01\x4B\x10\x8D\x38\x6C\xDB\x46\x92\xE0\xE0\x82\x7B\x6C",
@@ -66,6 +67,7 @@
array( 'RIFF1234WEBPVP8 ', false ),
array( 'RIFF1234WEBPVP8L ', false ),
);
+ // @codingStandardsIgnoreEnd
}
/**
diff --git a/tests/phpunit/includes/registration/ExtensionProcessorTest.php
b/tests/phpunit/includes/registration/ExtensionProcessorTest.php
index 1cb8a5d..ddf552e 100644
--- a/tests/phpunit/includes/registration/ExtensionProcessorTest.php
+++ b/tests/phpunit/includes/registration/ExtensionProcessorTest.php
@@ -379,13 +379,21 @@
array(
array( 'wgGroupPermissions' ),
array(
- 'wgGroupPermissions' => array( 'sysop'
=> array( 'delete' ) ),
+ 'wgGroupPermissions' => array(
+ 'sysop' => array( 'delete' )
+ ),
),
array(
- 'GroupPermissions' => array( 'sysop' =>
array( 'undelete' ), 'user' => array( 'edit' ) ),
+ 'GroupPermissions' => array(
+ 'sysop' => array( 'undelete' ),
+ 'user' => array( 'edit' )
+ ),
),
array(
- 'wgGroupPermissions' => array( 'sysop'
=> array( 'delete', 'undelete' ), 'user' => array( 'edit' ) ),
+ 'wgGroupPermissions' => array(
+ 'sysop' => array( 'delete',
'undelete' ),
+ 'user' => array( 'edit' )
+ ),
)
)
);
diff --git a/tests/phpunit/includes/upload/UploadBaseTest.php
b/tests/phpunit/includes/upload/UploadBaseTest.php
index 9441b77..9ec1b46 100644
--- a/tests/phpunit/includes/upload/UploadBaseTest.php
+++ b/tests/phpunit/includes/upload/UploadBaseTest.php
@@ -136,6 +136,7 @@
}
public static function provideCheckSvgScriptCallback() {
+ // @codingStandardsIgnoreStart Generic.Files.LineLength
return array(
// html5sec SVG vectors
array(
@@ -389,6 +390,7 @@
'SVG with local urls, including filter: in
style'
),
);
+ // @codingStandardsIgnoreEnd
}
}
--
To view, visit https://gerrit.wikimedia.org/r/243386
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iee3df5f064f595ecebe8210cc936bc3d20a122c9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Amire80 <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits