Fix Generic.Files.LineLength phpcs check in files under phpunit/includes
authorAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Sat, 3 Oct 2015 13:04:51 +0000 (16:04 +0300)
committerUmherirrender <umherirrender_de.wp@web.de>
Sat, 3 Oct 2015 17:13:29 +0000 (17:13 +0000)
Bug: T102614
Change-Id: Iee3df5f064f595ecebe8210cc936bc3d20a122c9

tests/phpunit/includes/ImportTest.php
tests/phpunit/includes/LinkerTest.php
tests/phpunit/includes/TestUser.php
tests/phpunit/includes/changes/TestRecentChangesHelper.php
tests/phpunit/includes/logging/LogFormatterTest.php
tests/phpunit/includes/logging/ProtectLogFormatterTest.php
tests/phpunit/includes/mail/MailAddressTest.php
tests/phpunit/includes/media/WebPTest.php
tests/phpunit/includes/registration/ExtensionProcessorTest.php
tests/phpunit/includes/upload/UploadBaseTest.php

index 7ef44e7..8ee2ad5 100644 (file)
@@ -38,7 +38,10 @@ class ImportTest extends MediaWikiLangTestCase {
                        }
                };
 
-               $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 @@ class ImportTest extends MediaWikiLangTestCase {
        }
 
        public function getRedirectXML() {
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                return array(
                        array(
                                <<< EOF
@@ -100,6 +104,7 @@ EOF
                                null
                        ),
                );
+               // @codingStandardsIgnoreEnd
        }
 
        /**
@@ -116,7 +121,10 @@ EOF
                        $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 @@ EOF
        }
 
        public function getSiteInfoXML() {
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                return array(
                        array(
                                <<< EOF
@@ -155,6 +164,7 @@ EOF
                                )
                        ),
                );
+               // @codingStandardsIgnoreEnd
        }
 
 }
index 19ab56f..b8b5a77 100644 (file)
@@ -131,6 +131,7 @@ class LinkerTest extends MediaWikiLangTestCase {
        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 @@ class LinkerTest extends MediaWikiLangTestCase {
                                false, false, $wikiId
                        )
                );
+               // @codingStandardsIgnoreEnd
        }
 
        /**
index 754568d..96b2251 100644 (file)
@@ -28,7 +28,9 @@ class TestUser {
 
        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" );
                }
        }
index 2506087..fe5bdd2 100644 (file)
@@ -25,8 +25,8 @@ class TestRecentChangesHelper {
                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 ),
index 1816708..478086b 100644 (file)
@@ -523,8 +523,10 @@ class LogFormatterTest extends MediaWikiLangTestCase {
 
                # 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
index 718c08c..558c0fd 100644 (file)
@@ -37,7 +37,8 @@ class ProtectLogFormatterTest extends LogFormatterTestCase {
                                        ),
                                ),
                                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 @@ class ProtectLogFormatterTest extends LogFormatterTestCase {
                                        ),
                                ),
                                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 @@ class ProtectLogFormatterTest extends LogFormatterTestCase {
                                ),
                                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 @@ class ProtectLogFormatterTest extends LogFormatterTestCase {
                                        ),
                                ),
                                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 @@ class ProtectLogFormatterTest extends LogFormatterTestCase {
                                ),
                                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 @@ class ProtectLogFormatterTest extends LogFormatterTestCase {
                                ),
                                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,
index 18d2acd..1fc63d9 100644 (file)
@@ -18,9 +18,15 @@ class MailAddressTest extends MediaWikiTestCase {
                        $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( 'foo@bar.baz' ) );
-               $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( 'foo@bar.baz' )
+               );
+               $user->expects( $this->any() )->method( 'getRealName' )->will(
+                       $this->returnValue( 'Real name' )
+               );
 
                $ma = MailAddress::newFromUser( $user );
                $this->assertInstanceOf( 'MailAddress', $ma );
index 285f280..b6d4114 100644 (file)
@@ -19,6 +19,7 @@ class WebPHandlerTest extends MediaWikiTestCase {
                $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 @@ class WebPHandlerTest extends MediaWikiTestCase {
                        array( 'RIFF1234WEBPVP8                     ', false ),
                        array( 'RIFF1234WEBPVP8L                    ', false ),
                );
+               // @codingStandardsIgnoreEnd
        }
 
        /**
index 1cb8a5d..ddf552e 100644 (file)
@@ -379,13 +379,21 @@ class ExtensionProcessorTest extends MediaWikiTestCase {
                        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' )
+                                       ),
                                )
                        )
                );
index 9441b77..9ec1b46 100644 (file)
@@ -136,6 +136,7 @@ class UploadBaseTest extends MediaWikiTestCase {
        }
 
        public static function provideCheckSvgScriptCallback() {
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                return array(
                        // html5sec SVG vectors
                        array(
@@ -389,6 +390,7 @@ class UploadBaseTest extends MediaWikiTestCase {
                                'SVG with local urls, including filter: in style'
                        ),
                );
+               // @codingStandardsIgnoreEnd
        }
 }