Merge "Fix ObjectCache::newAccelerator with string fallback in PHP 5.3"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 3 Oct 2015 18:18:07 +0000 (18:18 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 3 Oct 2015 18:18:07 +0000 (18:18 +0000)
40 files changed:
includes/HttpFunctions.php
includes/MWTimestamp.php
includes/PHPVersionCheck.php
includes/Revision.php
includes/api/ApiBlock.php
includes/api/ApiQueryAllMessages.php
includes/parser/Parser.php
includes/poolcounter/PoolCounterRedis.php
includes/specials/SpecialAllMessages.php
includes/specials/SpecialMergeHistory.php
includes/upload/UploadBase.php
tests/phpunit/includes/ImportTest.php
tests/phpunit/includes/LinkerTest.php
tests/phpunit/includes/TestUser.php
tests/phpunit/includes/WikiReferenceTest.php
tests/phpunit/includes/api/ApiContinuationManagerTest.php
tests/phpunit/includes/api/ApiEditPageTest.php
tests/phpunit/includes/api/ApiErrorFormatterTest.php
tests/phpunit/includes/api/ApiMainTest.php
tests/phpunit/includes/api/ApiModuleManagerTest.php
tests/phpunit/includes/api/ApiResultTest.php
tests/phpunit/includes/api/ApiRevisionDeleteTest.php
tests/phpunit/includes/api/format/ApiFormatDbgTest.php
tests/phpunit/includes/api/format/ApiFormatJsonTest.php
tests/phpunit/includes/api/format/ApiFormatNoneTest.php
tests/phpunit/includes/api/format/ApiFormatPhpTest.php
tests/phpunit/includes/api/format/ApiFormatTxtTest.php
tests/phpunit/includes/api/format/ApiFormatXmlTest.php
tests/phpunit/includes/changes/TestRecentChangesHelper.php
tests/phpunit/includes/content/CssContentHandlerTest.php
tests/phpunit/includes/libs/CSSMinTest.php
tests/phpunit/includes/libs/XmlTypeCheckTest.php
tests/phpunit/includes/libs/composer/ComposerLockTest.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/password/LayeredParameterizedPasswordTest.php
tests/phpunit/includes/registration/ExtensionProcessorTest.php
tests/phpunit/includes/upload/UploadBaseTest.php

index 578b535..bbf3de6 100644 (file)
@@ -250,7 +250,9 @@ class MWHttpRequest {
         * @param string $caller The method making this request, for profiling
         * @param Profiler $profiler An instance of the profiler for profiling, or null
         */
-       protected function __construct( $url, $options = array(), $caller = __METHOD__, $profiler = null ) {
+       protected function __construct(
+               $url, $options = array(), $caller = __METHOD__, $profiler = null
+       ) {
                global $wgHTTPTimeout, $wgHTTPConnectTimeout;
 
                $this->url = wfExpandUrl( $url, PROTO_HTTP );
@@ -870,8 +872,10 @@ class PhpHttpRequest extends MWHttpRequest {
        }
 
        /**
-        * Returns an array with a 'capath' or 'cafile' key that is suitable to be merged into the 'ssl' sub-array of a
-        * stream context options array. Uses the 'caInfo' option of the class if it is provided, otherwise uses the system
+        * Returns an array with a 'capath' or 'cafile' key
+        * that is suitable to be merged into the 'ssl' sub-array of
+        * a stream context options array.
+        * Uses the 'caInfo' option of the class if it is provided, otherwise uses the system
         * default CA bundle if PHP supports that, or searches a few standard locations.
         * @return array
         * @throws DomainException
@@ -882,10 +886,13 @@ class PhpHttpRequest extends MWHttpRequest {
                if ( $this->caInfo ) {
                        $certLocations = array( 'manual' => $this->caInfo );
                } elseif ( version_compare( PHP_VERSION, '5.6.0', '<' ) ) {
+                       // @codingStandardsIgnoreStart Generic.Files.LineLength
                        // Default locations, based on
                        // https://www.happyassassin.net/2015/01/12/a-note-about-ssltls-trusted-certificate-stores-and-platforms/
-                       // PHP 5.5 and older doesn't have any defaults, so we try to guess ourselves. PHP 5.6+ gets the CA location
-                       // from OpenSSL as long as it is not set manually, so we should leave capath/cafile empty there.
+                       // PHP 5.5 and older doesn't have any defaults, so we try to guess ourselves.
+                       // PHP 5.6+ gets the CA location from OpenSSL as long as it is not set manually,
+                       // so we should leave capath/cafile empty there.
+                       // @codingStandardsIgnoreEnd
                        $certLocations = array_filter( array(
                                getenv( 'SSL_CERT_DIR' ),
                                getenv( 'SSL_CERT_PATH' ),
@@ -914,8 +921,10 @@ class PhpHttpRequest extends MWHttpRequest {
        }
 
        /**
-        * Custom error handler for dealing with fopen() errors. fopen() tends to fire multiple errors in succession, and the last one
-        * is completely useless (something like "fopen: failed to open stream") so normal methods of handling errors programmatically
+        * Custom error handler for dealing with fopen() errors.
+        * fopen() tends to fire multiple errors in succession, and the last one
+        * is completely useless (something like "fopen: failed to open stream")
+        * so normal methods of handling errors programmatically
         * like get_last_error() don't work.
         */
        public function errorHandler( $errno, $errstr ) {
index 102be80..639403d 100644 (file)
@@ -203,11 +203,15 @@ class MWTimestamp {
         * @deprecated since 1.26 Use Language::getHumanTimestamp directly
         *
         * @param MWTimestamp|null $relativeTo The base timestamp to compare to (defaults to now)
-        * @param User|null $user User the timestamp is being generated for (or null to use main context's user)
-        * @param Language|null $lang Language to use to make the human timestamp (or null to use main context's language)
+        * @param User|null $user User the timestamp is being generated for
+        *  (or null to use main context's user)
+        * @param Language|null $lang Language to use to make the human timestamp
+        *  (or null to use main context's language)
         * @return string Formatted timestamp
         */
-       public function getHumanTimestamp( MWTimestamp $relativeTo = null, User $user = null, Language $lang = null ) {
+       public function getHumanTimestamp(
+               MWTimestamp $relativeTo = null, User $user = null, Language $lang = null
+       ) {
                if ( $lang === null ) {
                        $lang = RequestContext::getMain()->getLanguage();
                }
index 4b2ff8c..233ebf2 100644 (file)
@@ -188,12 +188,14 @@ function wfMissingVendorError( $type, $mwVersion ) {
                . "https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries\n"
                . "for help on installing the required components.";
 
+       // @codingStandardsIgnoreStart Generic.Files.LineLength
        $longHtml = <<<HTML
-                       MediaWiki now also has some external dependencies that need to be installed via
-                       composer or from a separate git repo. Please see
-                       <a href="https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries">mediawiki.org</a>
-                       for help on installing the required components.
+               MediaWiki now also has some external dependencies that need to be installed via
+               composer or from a separate git repo. Please see
+               <a href="https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries">mediawiki.org</a>
+               for help on installing the required components.
 HTML;
+       // @codingStandardsIgnoreEnd
 
        wfGenericError( $type, $mwVersion, 'External dependencies', $shortText, $longText, $longHtml );
 }
index 90d6265..a7a87e8 100644 (file)
@@ -1466,7 +1466,8 @@ class Revision implements IDBAccessObject {
        protected function checkContentModel() {
                global $wgContentHandlerUseDB;
 
-               $title = $this->getTitle(); // note: may return null for revisions that have not yet been inserted.
+               // Note: may return null for revisions that have not yet been inserted
+               $title = $this->getTitle();
 
                $model = $this->getContentModel();
                $format = $this->getContentFormat();
index 6adfc1a..636baa7 100644 (file)
@@ -162,12 +162,14 @@ class ApiBlock extends ApiBase {
        }
 
        protected function getExamplesMessages() {
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                return array(
                        'action=block&user=192.0.2.5&expiry=3%20days&reason=First%20strike&token=123ABC'
                                => 'apihelp-block-example-ip-simple',
                        'action=block&user=Vandal&expiry=never&reason=Vandalism&nocreate=&autoblock=&noemail=&token=123ABC'
                                => 'apihelp-block-example-user-complex',
                );
+               // @codingStandardsIgnoreEnd
        }
 
        public function getHelpUrls() {
index 152711f..d8a71ca 100644 (file)
@@ -116,7 +116,13 @@ class ApiQueryAllMessages extends ApiQueryBase {
                        $lang = $langObj->getCode();
 
                        $customisedMessages = AllMessagesTablePager::getCustomisedStatuses(
-                               array_map( array( $langObj, 'ucfirst' ), $messages_target ), $lang, $lang != $wgContLang->getCode() );
+                               array_map(
+                                       array( $langObj, 'ucfirst' ),
+                                       $messages_target
+                               ),
+                               $lang,
+                               $lang != $wgContLang->getCode()
+                       );
 
                        $customised = $params['customised'] === 'modified';
                }
index bbee9d4..efad151 100644 (file)
@@ -91,8 +91,10 @@ class Parser {
        # at least one character of a host name (embeds EXT_LINK_URL_CLASS)
        const EXT_LINK_ADDR = '(?:[0-9.]+|\\[(?i:[0-9a-f:.]+)\\]|[^][<>"\\x00-\\x20\\x7F\p{Zs}])';
        # RegExp to make image URLs (embeds IPv6 part of EXT_LINK_ADDR)
+       // @codingStandardsIgnoreStart Generic.Files.LineLength
        const EXT_IMAGE_REGEX = '/^(http:\/\/|https:\/\/)((?:\\[(?i:[0-9a-f:.]+)\\])?[^][<>"\\x00-\\x20\\x7F\p{Zs}]+)
                \\/([A-Za-z0-9_.,~%\\-+&;#*?!=()@\\x80-\\xFF]+)\\.((?i)gif|png|jpg|jpeg)$/Sxu';
+       // @codingStandardsIgnoreEnd
 
        # Regular expression for a non-newline space
        const SPACE_NOT_NL = '(?:\t|&nbsp;|&\#0*160;|&\#[Xx]0*[Aa]0;|\p{Zs})';
index d7357cf..6dd0b35 100644 (file)
@@ -149,6 +149,7 @@ class PoolCounterRedis extends PoolCounter {
                }
                $conn = $status->value;
 
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                static $script =
 <<<LUA
                local kSlots,kSlotsNextRelease,kWakeup,kWaiting = unpack(KEYS)
@@ -186,6 +187,8 @@ class PoolCounterRedis extends PoolCounter {
                end
                return 1
 LUA;
+               // @codingStandardsIgnoreEnd
+
                try {
                        $conn->luaEval( $script,
                                array(
index 762658c..ed1c903 100644 (file)
@@ -445,7 +445,11 @@ class AllMessagesTablePager extends TablePager {
                } elseif ( $field === 'am_title' ) {
                        return array( 'class' => $field );
                } else {
-                       return array( 'lang' => wfBCP47( $this->langcode ), 'dir' => $this->lang->getDir(), 'class' => $field );
+                       return array(
+                               'lang' => wfBCP47( $this->langcode ),
+                               'dir' => $this->lang->getDir(),
+                               'class' => $field
+                       );
                }
        }
 
index 7b75480..ef1fd73 100644 (file)
@@ -476,7 +476,12 @@ class SpecialMergeHistory extends SpecialPage {
                $logId = $logEntry->insert();
                $logEntry->publish( $logId );
 
-               $targetLink = Linker::link( $targetTitle, $targetTitle->getPrefixedText(), array(), array( 'redirect' => 'no' ) );
+               $targetLink = Linker::link(
+                       $targetTitle,
+                       $targetTitle->getPrefixedText(),
+                       array(),
+                       array( 'redirect' => 'no' )
+               );
 
                $this->getOutput()->addWikiMsg( $this->msg( 'mergehistory-done' )
                        ->rawParams( $targetLink )
index 508f62e..5193a7f 100644 (file)
@@ -1399,7 +1399,10 @@ abstract class UploadBase {
                        # image/svg, text/xml, application/xml, and text/html, which can contain scripts
                        if ( $stripped == 'href' && strncasecmp( 'data:', $value, 5 ) === 0 ) {
                                // rfc2397 parameters. This is only slightly slower than (;[\w;]+)*.
+                               // @codingStandardsIgnoreStart Generic.Files.LineLength
                                $parameters = '(?>;[a-zA-Z0-9\!#$&\'*+.^_`{|}~-]+=(?>[a-zA-Z0-9\!#$&\'*+.^_`{|}~-]+|"(?>[\0-\x0c\x0e-\x21\x23-\x5b\x5d-\x7f]+|\\\\[\0-\x7f])*"))*(?:;base64)?';
+                               // @codingStandardsIgnoreEnd
+
                                if ( !preg_match( "!^data:\s*image/(gif|jpeg|jpg|png)$parameters,!i", $value ) ) {
                                        wfDebug( __METHOD__ . ": Found href to unwhitelisted data: uri "
                                                . "\"<$strippedElement '$attrib'='$value'...\" in uploaded file.\n" );
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..58634d4 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
        }
 
        /**
@@ -287,6 +289,7 @@ class LinkerTest extends MediaWikiLangTestCase {
        }
 
        public static function provideCasesForFormatLinksInComment() {
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                return array(
                        array(
                                'foo bar <a href="/wiki/Special:BlankPage" title="Special:BlankPage">Special:BlankPage</a>',
@@ -304,5 +307,6 @@ class LinkerTest extends MediaWikiLangTestCase {
                                'enwiki',
                        ),
                );
+               // @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 85ddafc..bcef403 100644 (file)
@@ -85,7 +85,9 @@ class WikiReferenceTest extends PHPUnit_Framework_TestCase {
        /**
         * @dataProvider provideGetCanonicalUrl
         */
-       public function testGetCanonicalUrl( $expected, $canonicalServer, $server, $path, $page, $fragmentId ) {
+       public function testGetCanonicalUrl(
+               $expected, $canonicalServer, $server, $path, $page, $fragmentId
+       ) {
                $reference = new WikiReference( $canonicalServer, $path, $server );
                $this->assertEquals( $expected, $reference->getCanonicalUrl( $page, $fragmentId ) );
        }
index 2edf0c6..30b679d 100644 (file)
@@ -168,13 +168,18 @@ class ApiContinuationManagerTest extends MediaWikiTestCase {
                        );
                }
 
-               $manager = self::getManager( '||mock2', array_slice( $allModules, 0, 2 ), array( 'mock1', 'mock2' ) );
+               $manager = self::getManager(
+                       '||mock2',
+                       array_slice( $allModules, 0, 2 ),
+                       array( 'mock1', 'mock2' )
+               );
                try {
                        $manager->addContinueParam( $allModules[1], 'm2continue', 1 );
                        $this->fail( 'Expected exception not thrown' );
                } catch ( UnexpectedValueException $ex ) {
                        $this->assertSame(
-                               'Module \'mock2\' was not supposed to have been executed, but it was executed anyway',
+                               'Module \'mock2\' was not supposed to have been executed, ' .
+                                       'but it was executed anyway',
                                $ex->getMessage(),
                                'Expected exception'
                        );
@@ -184,7 +189,8 @@ class ApiContinuationManagerTest extends MediaWikiTestCase {
                        $this->fail( 'Expected exception not thrown' );
                } catch ( UnexpectedValueException $ex ) {
                        $this->assertSame(
-                               'Module \'mocklist\' called ApiContinuationManager::addContinueParam but was not passed to ApiContinuationManager::__construct',
+                               'Module \'mocklist\' called ApiContinuationManager::addContinueParam ' .
+                                       'but was not passed to ApiContinuationManager::__construct',
                                $ex->getMessage(),
                                'Expected exception'
                        );
index 6a24281..4a90bf8 100644 (file)
@@ -475,7 +475,8 @@ class ApiEditPageTest extends ApiTestCase {
        public function testCheckDirectApiEditingDisallowed_forNonTextContent() {
                $this->setExpectedException(
                        'UsageException',
-                       'Direct editing via API is not supported for content model testing used by Dummy:ApiEditPageTest_nonTextPageEdit'
+                       'Direct editing via API is not supported for content model ' .
+                               'testing used by Dummy:ApiEditPageTest_nonTextPageEdit'
                );
 
                $this->doApiRequestWithToken( array(
index 8ebdf60..3e5f355 100644 (file)
@@ -130,13 +130,21 @@ class ApiErrorFormatterTest extends MediaWikiTestCase {
                                array(
                                        'errors' => array(
                                                'err' => array(
-                                                       array( 'code' => 'mainpage', 'message' => 'mainpage', 'params' => array( $I => 'param' ) ),
+                                                       array(
+                                                               'code' => 'mainpage',
+                                                               'message' => 'mainpage',
+                                                               'params' => array( $I => 'param' )
+                                                       ),
                                                        $I => 'error',
                                                ),
                                        ),
                                        'warnings' => array(
                                                'string' => array(
-                                                       array( 'code' => 'mainpage', 'message' => 'mainpage', 'params' => array( $I => 'param' ) ),
+                                                       array(
+                                                               'code' => 'mainpage',
+                                                               'message' => 'mainpage',
+                                                               'params' => array( $I => 'param' )
+                                                       ),
                                                        $I => 'warning',
                                                ),
                                        ),
@@ -144,24 +152,44 @@ class ApiErrorFormatterTest extends MediaWikiTestCase {
                                array(
                                        'errors' => array(
                                                'errWithData' => array(
-                                                       array( 'code' => 'overriddenCode', 'message' => 'mainpage', 'params' => array( $I => 'param' ),
-                                                               'overriddenData' => true ),
+                                                       array(
+                                                               'code' => 'overriddenCode',
+                                                               'message' => 'mainpage',
+                                                               'params' => array( $I => 'param' ),
+                                                               'overriddenData' => true
+                                                       ),
                                                        $I => 'error',
                                                ),
                                        ),
                                        'warnings' => array(
                                                'messageWithData' => array(
-                                                       array( 'code' => 'overriddenCode', 'message' => 'mainpage', 'params' => array( $I => 'param' ),
-                                                               'overriddenData' => true ),
+                                                       array(
+                                                               'code' => 'overriddenCode',
+                                                               'message' => 'mainpage',
+                                                               'params' => array( $I => 'param' ),
+                                                               'overriddenData' => true
+                                                       ),
                                                        $I => 'warning',
                                                ),
                                                'message' => array(
-                                                       array( 'code' => 'mainpage', 'message' => 'mainpage', 'params' => array( $I => 'param' ) ),
+                                                       array(
+                                                               'code' => 'mainpage',
+                                                               'message' => 'mainpage',
+                                                               'params' => array( $I => 'param' )
+                                                       ),
                                                        $I => 'warning',
                                                ),
                                                'foo' => array(
-                                                       array( 'code' => 'mainpage', 'message' => 'mainpage', 'params' => array( $I => 'param' ) ),
-                                                       array( 'code' => 'parentheses', 'message' => 'parentheses', 'params' => array( 'foobar', $I => 'param' ) ),
+                                                       array(
+                                                               'code' => 'mainpage',
+                                                               'message' => 'mainpage',
+                                                               'params' => array( $I => 'param' )
+                                                       ),
+                                                       array(
+                                                               'code' => 'parentheses',
+                                                               'message' => 'parentheses',
+                                                               'params' => array( 'foobar', $I => 'param' )
+                                                       ),
                                                        $I => 'warning',
                                                ),
                                        ),
@@ -169,17 +197,37 @@ class ApiErrorFormatterTest extends MediaWikiTestCase {
                                array(
                                        'errors' => array(
                                                'status' => array(
-                                                       array( 'code' => 'mainpage', 'message' => 'mainpage', 'params' => array( $I => 'param' ) ),
-                                                       array( 'code' => 'parentheses', 'message' => 'parentheses', 'params' => array( 'foobar', $I => 'param' ) ),
+                                                       array(
+                                                               'code' => 'mainpage',
+                                                               'message' => 'mainpage',
+                                                               'params' => array( $I => 'param' )
+                                                       ),
+                                                       array(
+                                                               'code' => 'parentheses',
+                                                               'message' => 'parentheses',
+                                                               'params' => array( 'foobar', $I => 'param' )
+                                                       ),
                                                        $I => 'error',
                                                ),
                                        ),
                                        'warnings' => array(
                                                'status' => array(
-                                                       array( 'code' => 'mainpage', 'message' => 'mainpage', 'params' => array( $I => 'param' ) ),
-                                                       array( 'code' => 'parentheses', 'message' => 'parentheses', 'params' => array( 'foobar', $I => 'param' ) ),
-                                                       array( 'code' => 'overriddenCode', 'message' => 'mainpage', 'params' => array( $I => 'param' ),
-                                                               'overriddenData' => true ),
+                                                       array(
+                                                               'code' => 'mainpage',
+                                                               'message' => 'mainpage',
+                                                               'params' => array( $I => 'param' )
+                                                       ),
+                                                       array(
+                                                               'code' => 'parentheses',
+                                                               'message' => 'parentheses',
+                                                               'params' => array( 'foobar', $I => 'param' )
+                                                       ),
+                                                       array(
+                                                               'code' => 'overriddenCode',
+                                                               'message' => 'mainpage',
+                                                               'params' => array( $I => 'param' ),
+                                                               'overriddenData' => true
+                                                       ),
                                                        $I => 'warning',
                                                ),
                                        ),
@@ -328,8 +376,16 @@ class ApiErrorFormatterTest extends MediaWikiTestCase {
                $I = ApiResult::META_INDEXED_TAG_NAME;
                $this->assertSame(
                        array(
-                               array( 'type' => 'error', 'message' => 'mainpage', 'params' => array( $I => 'param' ) ),
-                               array( 'type' => 'error', 'message' => 'parentheses', 'params' => array( 'foobar', $I => 'param' ) ),
+                               array(
+                                       'type' => 'error',
+                                       'message' => 'mainpage',
+                                       'params' => array( $I => 'param' )
+                               ),
+                               array(
+                                       'type' => 'error',
+                                       'message' => 'parentheses',
+                                       'params' => array( 'foobar', $I => 'param' )
+                               ),
                                $I => 'error',
                        ),
                        $formatter->arrayFromStatus( $status, 'error' ),
@@ -337,10 +393,26 @@ class ApiErrorFormatterTest extends MediaWikiTestCase {
                );
                $this->assertSame(
                        array(
-                               array( 'type' => 'warning', 'message' => 'mainpage', 'params' => array( $I => 'param' ) ),
-                               array( 'type' => 'warning', 'message' => 'parentheses', 'params' => array( 'foobar', $I => 'param' ) ),
-                               array( 'message' => 'mainpage', 'params' => array( $I => 'param' ), 'type' => 'warning' ),
-                               array( 'message' => 'mainpage', 'params' => array( $I => 'param' ), 'type' => 'warning' ),
+                               array(
+                                       'type' => 'warning',
+                                       'message' => 'mainpage',
+                                       'params' => array( $I => 'param' )
+                               ),
+                               array(
+                                       'type' => 'warning',
+                                       'message' => 'parentheses',
+                                       'params' => array( 'foobar', $I => 'param' )
+                               ),
+                               array(
+                                       'message' => 'mainpage',
+                                       'params' => array( $I => 'param' ),
+                                       'type' => 'warning'
+                               ),
+                               array(
+                                       'message' => 'mainpage',
+                                       'params' => array( $I => 'param' ),
+                                       'type' => 'warning'
+                               ),
                                $I => 'warning',
                        ),
                        $formatter->arrayFromStatus( $status, 'warning' ),
index 94b741d..aef4815 100644 (file)
@@ -90,7 +90,9 @@ class ApiMainTest extends ApiTestCase {
         * @param int $status Expected response status
         * @param bool $post Request is a POST
         */
-       public function testCheckConditionalRequestHeaders( $headers, $conditions, $status, $post = false ) {
+       public function testCheckConditionalRequestHeaders(
+               $headers, $conditions, $status, $post = false
+       ) {
                $request = new FauxRequest( array( 'action' => 'query', 'meta' => 'siteinfo' ), $post );
                $request->setHeaders( $headers );
                $request->response()->statusHeader( 200 ); // Why doesn't it default?
@@ -186,7 +188,9 @@ class ApiMainTest extends ApiTestCase {
         * @param bool $isError $isError flag
         * @param bool $post Request is a POST
         */
-       public function testConditionalRequestHeadersOutput( $conditions, $headers, $isError = false, $post = false ) {
+       public function testConditionalRequestHeadersOutput(
+               $conditions, $headers, $isError = false, $post = false
+       ) {
                $request = new FauxRequest( array( 'action' => 'query', 'meta' => 'siteinfo' ), $post );
                $response = $request->response();
 
index dab81e1..5e74f13 100644 (file)
@@ -307,12 +307,24 @@ class ApiModuleManagerTest extends MediaWikiTestCase {
                $moduleManager->addModules( $fooModules, 'foo' );
                $moduleManager->addModules( $barModules, 'bar' );
 
-               $this->assertEquals( 'ApiLogin', $moduleManager->getClassName( 'login' ) );
-               $this->assertEquals( 'ApiLogout', $moduleManager->getClassName( 'logout' ) );
-               $this->assertEquals( 'ApiFeedContributions', $moduleManager->getClassName( 'feedcontributions' ) );
-               $this->assertEquals( 'ApiFeedRecentChanges', $moduleManager->getClassName( 'feedrecentchanges' ) );
-               $this->assertFalse( $moduleManager->getClassName( 'nonexistentmodule' ) );
+               $this->assertEquals(
+                       'ApiLogin',
+                       $moduleManager->getClassName( 'login' )
+               );
+               $this->assertEquals(
+                       'ApiLogout',
+                       $moduleManager->getClassName( 'logout' )
+               );
+               $this->assertEquals(
+                       'ApiFeedContributions',
+                       $moduleManager->getClassName( 'feedcontributions' )
+               );
+               $this->assertEquals(
+                       'ApiFeedRecentChanges',
+                       $moduleManager->getClassName( 'feedrecentchanges' )
+               );
+               $this->assertFalse(
+                       $moduleManager->getClassName( 'nonexistentmodule' )
+               );
        }
-
-
 }
index 2f31677..d43db71 100644 (file)
@@ -973,7 +973,12 @@ class ApiResultTest extends MediaWikiTestCase {
                                        'kvpmerge' => array(
                                                $kvp( 'name', 'x', 'value', 'a' ),
                                                $kvp( 'name', 'y', 'value', array( 'b', ApiResult::META_TYPE => 'array' ) ),
-                                               array( 'name' => 'z', 'c' => 'd', ApiResult::META_TYPE => 'assoc', ApiResult::META_PRESERVE_KEYS => array( 'name' ) ),
+                                               array(
+                                                       'name' => 'z',
+                                                       'c' => 'd',
+                                                       ApiResult::META_TYPE => 'assoc',
+                                                       ApiResult::META_PRESERVE_KEYS => array( 'name' )
+                                               ),
                                                ApiResult::META_TYPE => 'array',
                                                ApiResult::META_KVP_MERGE => true,
                                        ),
@@ -1011,7 +1016,11 @@ class ApiResultTest extends MediaWikiTestCase {
                                        'kvpmerge' => array(
                                                $kvp( 'name', 'x', '*', 'a' ),
                                                $kvp( 'name', 'y', '*', array( 'b', ApiResult::META_TYPE => 'array' ) ),
-                                               array( 'name' => 'z', 'c' => 'd', ApiResult::META_TYPE => 'assoc', ApiResult::META_PRESERVE_KEYS => array( 'name' ) ),
+                                               array(
+                                                       'name' => 'z',
+                                                       'c' => 'd',
+                                                       ApiResult::META_TYPE => 'assoc',
+                                                       ApiResult::META_PRESERVE_KEYS => array( 'name' ) ),
                                                ApiResult::META_TYPE => 'array',
                                                ApiResult::META_KVP_MERGE => true,
                                        ),
@@ -1053,7 +1062,12 @@ class ApiResultTest extends MediaWikiTestCase {
                                        'kvpmerge' => array(
                                                (object)$kvp( 'name', 'x', 'value', 'a' ),
                                                (object)$kvp( 'name', 'y', 'value', array( 'b', ApiResult::META_TYPE => 'array' ) ),
-                                               (object)array( 'name' => 'z', 'c' => 'd', ApiResult::META_TYPE => 'assoc', ApiResult::META_PRESERVE_KEYS => array( 'name' ) ),
+                                               (object)array(
+                                                       'name' => 'z',
+                                                       'c' => 'd',
+                                                       ApiResult::META_TYPE => 'assoc',
+                                                       ApiResult::META_PRESERVE_KEYS => array( 'name' )
+                                               ),
                                                ApiResult::META_TYPE => 'array',
                                                ApiResult::META_KVP_MERGE => true,
                                        ),
index 362d647..575859b 100644 (file)
@@ -14,12 +14,16 @@ class ApiRevisionDeleteTest extends ApiTestCase {
 
        protected function setUp() {
                // Needs to be before setup since this gets cached
-               $this->mergeMwGlobalArrayValue( 'wgGroupPermissions', array( 'sysop' => array( 'deleterevision' => true ) ) );
+               $this->mergeMwGlobalArrayValue(
+                       'wgGroupPermissions',
+                       array( 'sysop' => array( 'deleterevision' => true ) )
+               );
                parent::setUp();
                // Make a few edits for us to play with
                for ( $i = 1; $i <= 5; $i++ ) {
                        self::editPage( self::$page, MWCryptRand::generateHex( 10 ), 'summary' );
-                       $this->revs[] = Title::newFromText( self::$page )->getLatestRevID( Title::GAID_FOR_UPDATE );
+                       $this->revs[] = Title::newFromText( self::$page )
+                               ->getLatestRevID( Title::GAID_FOR_UPDATE );
                }
 
        }
index 3fcfc73..addd16a 100644 (file)
@@ -29,18 +29,55 @@ class ApiFormatDbgTest extends ApiFormatTestBase {
                        array( array( 'fóo' ), "array ({$warning}\n  0 => 'fóo',\n)" ),
 
                        // Arrays and objects
-                       array( array( array() ), "array ({$warning}\n  0 => \n  array (\n  ),\n)" ),
-                       array( array( array( 1 ) ), "array ({$warning}\n  0 => \n  array (\n    0 => 1,\n  ),\n)" ),
-                       array( array( array( 'x' => 1 ) ), "array ({$warning}\n  0 => \n  array (\n    'x' => 1,\n  ),\n)" ),
-                       array( array( array( 2 => 1 ) ), "array ({$warning}\n  0 => \n  array (\n    2 => 1,\n  ),\n)" ),
-                       array( array( (object)array() ), "array ({$warning}\n  0 => \n  array (\n  ),\n)" ),
-                       array( array( array( 1, ApiResult::META_TYPE => 'assoc' ) ), "array ({$warning}\n  0 => \n  array (\n    0 => 1,\n  ),\n)" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'array' ) ), "array ({$warning}\n  0 => \n  array (\n    0 => 1,\n  ),\n)" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'kvp' ) ), "array ({$warning}\n  0 => \n  array (\n    'x' => 1,\n  ),\n)" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCkvp', ApiResult::META_KVP_KEY_NAME => 'key' ) ),
-                               "array ({$warning}\n  0 => \n  array (\n    0 => \n    array (\n      'key' => 'x',\n      '*' => 1,\n    ),\n  ),\n)" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCarray' ) ), "array ({$warning}\n  0 => \n  array (\n    'x' => 1,\n  ),\n)" ),
-                       array( array( array( 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ) ), "array ({$warning}\n  0 => \n  array (\n    0 => 'a',\n    1 => 'b',\n  ),\n)" ),
+                       array(
+                               array( array() ),
+                               "array ({$warning}\n  0 => \n  array (\n  ),\n)"
+                       ),
+                       array(
+                               array( array( 1 ) ),
+                               "array ({$warning}\n  0 => \n  array (\n    0 => 1,\n  ),\n)"
+                       ),
+                       array(
+                               array( array( 'x' => 1 ) ),
+                               "array ({$warning}\n  0 => \n  array (\n    'x' => 1,\n  ),\n)"
+                       ),
+                       array(
+                               array( array( 2 => 1 ) ),
+                               "array ({$warning}\n  0 => \n  array (\n    2 => 1,\n  ),\n)"
+                       ),
+                       array(
+                               array( (object)array() ),
+                               "array ({$warning}\n  0 => \n  array (\n  ),\n)"
+                       ),
+                       array(
+                               array( array( 1, ApiResult::META_TYPE => 'assoc' ) ),
+                               "array ({$warning}\n  0 => \n  array (\n    0 => 1,\n  ),\n)"
+                       ),
+                       array(
+                               array( array( 'x' => 1, ApiResult::META_TYPE => 'array' ) ),
+                               "array ({$warning}\n  0 => \n  array (\n    0 => 1,\n  ),\n)"
+                       ),
+                       array(
+                               array( array( 'x' => 1, ApiResult::META_TYPE => 'kvp' ) ),
+                               "array ({$warning}\n  0 => \n  array (\n    'x' => 1,\n  ),\n)"
+                       ),
+                       array(
+                               array( array(
+                                       'x' => 1,
+                                       ApiResult::META_TYPE => 'BCkvp',
+                                       ApiResult::META_KVP_KEY_NAME => 'key'
+                               ) ),
+                               "array ({$warning}\n  0 => \n  array (\n    0 => \n    " .
+                                       "array (\n      'key' => 'x',\n      '*' => 1,\n    ),\n  ),\n)"
+                       ),
+                       array(
+                               array( array( 'x' => 1, ApiResult::META_TYPE => 'BCarray' ) ),
+                               "array ({$warning}\n  0 => \n  array (\n    'x' => 1,\n  ),\n)"
+                       ),
+                       array(
+                               array( array( 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ) ),
+                               "array ({$warning}\n  0 => \n  array (\n    0 => 'a',\n    1 => 'b',\n  ),\n)"
+                       ),
 
                        // Content
                        array( array( 'content' => 'foo', ApiResult::META_CONTENT => 'content' ),
index 3dfcaf0..f7ffcb9 100644 (file)
@@ -44,8 +44,14 @@ class ApiFormatJsonTest extends ApiFormatTestBase {
                                array( array( array( 1, ApiResult::META_TYPE => 'assoc' ) ), '[{"0":1}]' ),
                                array( array( array( 'x' => 1, ApiResult::META_TYPE => 'array' ) ), '[[1]]' ),
                                array( array( array( 'x' => 1, ApiResult::META_TYPE => 'kvp' ) ), '[{"x":1}]' ),
-                               array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCkvp', ApiResult::META_KVP_KEY_NAME => 'key' ) ),
-                                       '[[{"key":"x","*":1}]]' ),
+                               array(
+                                       array( array(
+                                               'x' => 1,
+                                               ApiResult::META_TYPE => 'BCkvp',
+                                               ApiResult::META_KVP_KEY_NAME => 'key'
+                                       ) ),
+                                       '[[{"key":"x","*":1}]]'
+                               ),
                                array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCarray' ) ), '[{"x":1}]' ),
                                array( array( array( 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ) ), '[["a","b"]]' ),
 
@@ -85,10 +91,23 @@ class ApiFormatJsonTest extends ApiFormatTestBase {
                                array( array( array( 1, ApiResult::META_TYPE => 'assoc' ) ), '[{"0":1}]' ),
                                array( array( array( 'x' => 1, ApiResult::META_TYPE => 'array' ) ), '[[1]]' ),
                                array( array( array( 'x' => 1, ApiResult::META_TYPE => 'kvp' ) ), '[{"x":1}]' ),
-                               array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCkvp', ApiResult::META_KVP_KEY_NAME => 'key' ) ),
-                                       '[{"x":1}]' ),
+                               array(
+                                       array( array(
+                                               'x' => 1,
+                                               ApiResult::META_TYPE => 'BCkvp',
+                                               ApiResult::META_KVP_KEY_NAME => 'key'
+                                       ) ),
+                                       '[{"x":1}]'
+                               ),
                                array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCarray' ) ), '[[1]]' ),
-                               array( array( array( 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ) ), '[{"0":"a","1":"b"}]' ),
+                               array(
+                                       array( array(
+                                               'a',
+                                               'b',
+                                               ApiResult::META_TYPE => 'BCassoc'
+                                       ) ),
+                                       '[{"0":"a","1":"b"}]'
+                               ),
 
                                // Content
                                array( array( 'content' => 'foo', ApiResult::META_CONTENT => 'content' ),
index 8f81a41..c0192bc 100644 (file)
@@ -29,7 +29,14 @@ class ApiFormatNoneTest extends ApiFormatTestBase {
                        array( array( array( 1, ApiResult::META_TYPE => 'assoc' ) ), '' ),
                        array( array( array( 'x' => 1, ApiResult::META_TYPE => 'array' ) ), '' ),
                        array( array( array( 'x' => 1, ApiResult::META_TYPE => 'kvp' ) ), '' ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCkvp', ApiResult::META_KVP_KEY_NAME => 'key' ) ), '' ),
+                       array(
+                               array( array(
+                                       'x' => 1,
+                                       ApiResult::META_TYPE => 'BCkvp',
+                                       ApiResult::META_KVP_KEY_NAME => 'key'
+                               ) ),
+                               ''
+                       ),
                        array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCarray' ) ), '' ),
                        array( array( array( 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ) ), '' ),
 
index 09c7c0c..fd06ad0 100644 (file)
@@ -20,6 +20,7 @@ class ApiFormatPhpTest extends ApiFormatTestBase {
        }
 
        public static function provideGeneralEncoding() {
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                return array_merge(
                        self::addFormatVersion( 1, array(
                                // Basic types
@@ -96,6 +97,7 @@ class ApiFormatPhpTest extends ApiFormatTestBase {
                                        'a:1:{s:3:"foo";s:3:"foo";}' ),
                        ) )
                );
+               // @codingStandardsIgnoreEnd
        }
 
        public function testCrossDomainMangling() {
@@ -134,7 +136,8 @@ class ApiFormatPhpTest extends ApiFormatTestBase {
                } catch ( UsageException $ex ) {
                        ob_end_clean();
                        $this->assertSame(
-                               'This response cannot be represented using format=php. See https://phabricator.wikimedia.org/T68776',
+                               'This response cannot be represented using format=php. ' .
+                                       'See https://phabricator.wikimedia.org/T68776',
                                $ex->getMessage(),
                                'Expected exception'
                        );
index b0a2a96..c779a3c 100644 (file)
@@ -9,6 +9,7 @@ class ApiFormatTxtTest extends ApiFormatTestBase {
        protected $printerName = 'txt';
 
        public static function provideGeneralEncoding() {
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                $warning = "\n    [warnings] => Array\n        (\n            [txt] => Array\n                (\n" .
                        "                    [*] => format=txt has been deprecated. Please use format=json instead.\n" .
                        "                )\n\n        )\n";
@@ -50,6 +51,7 @@ class ApiFormatTxtTest extends ApiFormatTestBase {
                        array( array( 'foo' => 'foo', ApiResult::META_BC_SUBELEMENTS => array( 'foo' ) ),
                                "Array\n({$warning}\n    [foo] => Array\n        (\n            [*] => foo\n        )\n\n)\n" ),
                );
+               // @codingStandardsIgnoreEnd
        }
 
 }
index 7babaed..0b7ae35 100644 (file)
@@ -12,9 +12,11 @@ class ApiFormatXmlTest extends ApiFormatTestBase {
        public static function setUpBeforeClass() {
                parent::setUpBeforeClass();
                $page = WikiPage::factory( Title::newFromText( 'MediaWiki:ApiFormatXmlTest.xsl' ) );
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                $page->doEditContent( new WikitextContent(
                        '<?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" />'
                ), 'Summary' );
+               // @codingStandardsIgnoreEnd
                $page = WikiPage::factory( Title::newFromText( 'MediaWiki:ApiFormatXmlTest' ) );
                $page->doEditContent( new WikitextContent( 'Bogus' ), 'Summary' );
                $page = WikiPage::factory( Title::newFromText( 'ApiFormatXmlTest' ) );
@@ -22,6 +24,7 @@ class ApiFormatXmlTest extends ApiFormatTestBase {
        }
 
        public static function provideGeneralEncoding() {
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                return array(
                        // Basic types
                        array( array( null, 'a' => null ), '<?xml version="1.0"?><api><_v _idx="0" /></api>' ),
@@ -114,6 +117,7 @@ class ApiFormatXmlTest extends ApiFormatTestBase {
                                        '" type="text/xsl" ?><api />',
                                array( 'xslt' => 'MediaWiki:ApiFormatXmlTest.xsl' ) ),
                );
+               // @codingStandardsIgnoreEnd
        }
 
 }
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 e1785a9..58735bc 100644 (file)
@@ -21,10 +21,12 @@ class CssContentHandlerTest extends MediaWikiTestCase {
         * Keep this in sync with CssContentTest::provideGetRedirectTarget()
         */
        public static function provideMakeRedirectContent() {
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                return array(
                        array( 'MediaWiki:MonoBook.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=MediaWiki:MonoBook.css&action=raw&ctype=text/css);" ),
                        array( 'User:FooBar/common.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=User:FooBar/common.css&action=raw&ctype=text/css);" ),
                        array( 'Gadget:FooBaz.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=Gadget:FooBaz.css&action=raw&ctype=text/css);" ),
                );
+               // @codingStandardsIgnoreEnd
        }
 }
index 7841f30..f4f7bfd 100644 (file)
@@ -188,6 +188,7 @@ class CSSMinTest extends MediaWikiTestCase {
                        . '%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228%22%20height%3D'
                        . '%228%22%3E%0A%3Ccircle%20cx%3D%224%22%20cy%3D%224%22%20r%3D%222%22%2F%3E%0A%3C%2Fsvg%3E%0A';
 
+               // @codingStandardsIgnoreStart Generic.Files.LineLength
                return array(
                        array(
                                'Regular file',
@@ -374,6 +375,7 @@ class CSSMinTest extends MediaWikiTestCase {
                                '.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(http://localhost/w/images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; }',
                        ),
                );
+               // @codingStandardsIgnoreEnd
        }
 
        /**
index f0ba934..c43d550 100644 (file)
@@ -8,7 +8,9 @@
 class XmlTypeCheckTest extends PHPUnit_Framework_TestCase {
        const WELL_FORMED_XML = "<root><child /></root>";
        const MAL_FORMED_XML = "<root><child /></error>";
+       // @codingStandardsIgnoreStart Generic.Files.LineLength
        const XML_WITH_PIH = '<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/w/index.php"?><svg><child /></svg>';
+       // @codingStandardsIgnoreEnd
 
        /**
         * @covers XMLTypeCheck::newFromString
index cac3b10..6b374f2 100644 (file)
@@ -38,7 +38,8 @@ class ComposerLockTest extends MediaWikiTestCase {
                                                'email' => 'chad@wikimedia.org',
                                        ),
                                ),
-                               'description' => 'Constant Database (CDB) wrapper library for PHP. Provides pure-PHP fallback when dba_* functions are absent.',
+                               'description' => 'Constant Database (CDB) wrapper library for PHP. '.
+                                       'Provides pure-PHP fallback when dba_* functions are absent.',
                        ),
                        'cssjanus/cssjanus' => array(
                                'version' => '1.1.1',
@@ -108,14 +109,18 @@ class ComposerLockTest extends MediaWikiTestCase {
                                                'role' => 'Developer',
                                        ),
                                ),
-                               'description' => 'The only standard solution to translate any kind of text with an avant-garde web interface within MediaWiki, including your documentation and software',
+                               'description' => 'The only standard solution to translate any kind ' .
+                                       'of text with an avant-garde web interface within MediaWiki, ' .
+                                       'including your documentation and software',
                        ),
                        'mediawiki/universal-language-selector' => array(
                                'version' => '2014.12',
                                'type' => 'mediawiki-extension',
                                'licenses' => array( 'GPL-2.0+', 'MIT' ),
                                'authors' => array(),
-                               'description' => 'The primary aim is to allow users to select a language and configure its support in an easy way. Main features are language selection, input methods and web fonts.',
+                               'description' => 'The primary aim is to allow users to select a language ' .
+                                       'and configure its support in an easy way. ' .
+                                       'Main features are language selection, input methods and web fonts.',
                        ),
                ), $lock->getInstalledDependencies(), false, true );
        }
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..17decf3 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,
@@ -250,7 +255,9 @@ class ProtectLogFormatterTest extends LogFormatterTestCase {
                                        ),
                                ),
                                array(
-                                       'text' => 'User changed protection level for ProtectPage [Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite) [cascading]',
+                                       'text' => 'User changed protection level for ProtectPage ' .
+                                               '[Edit=Allow only administrators] (indefinite) ' .
+                                               '[Move=Allow only administrators] (indefinite) [cascading]',
                                        'api' => array(
                                                'description' => '[edit=sysop] (indefinite)[move=sysop] (indefinite)',
                                                'cascade' => true,
@@ -287,7 +294,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 +318,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..a92f25a 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
        }
 
        /**
@@ -76,10 +78,22 @@ class WebPHandlerTest extends MediaWikiTestCase {
        }
        public function provideTestWithFileExtractMetaData() {
                return array(
-                               array( __DIR__ . '/../../data/media/2_webp_ll.webp',
-                                       array( 'compression' => 'lossless', 'width' => 386, 'height' => 395 ) ),
-                               array( __DIR__ . '/../../data/media/2_webp_a.webp',
-                                       array( 'compression' => 'lossy', 'animated' => false, 'transparency' => true, 'width' => 386, 'height' => 395 ) ),
+                       array( __DIR__ . '/../../data/media/2_webp_ll.webp',
+                               array(
+                                       'compression' => 'lossless',
+                                       'width' => 386,
+                                       'height' => 395
+                               )
+                       ),
+                       array( __DIR__ . '/../../data/media/2_webp_a.webp',
+                               array(
+                                       'compression' => 'lossy',
+                                       'animated' => false,
+                                       'transparency' => true,
+                                       'width' => 386,
+                                       'height' => 395
+                               )
+                       ),
                );
        }
 
index 86e8270..368fda1 100644 (file)
@@ -27,11 +27,11 @@ class LayeredParameterizedPasswordTest extends PasswordTestCase {
        }
 
        public static function providePasswordTests() {
-               /** @codingStandardsIgnoreStart Generic.Files.LineLength.TooLong */
+               // @codingStandardsIgnoreStart Generic.Files.LineLength.TooLong
                return array(
                        array( true, ':testLargeLayeredTop:sha512:1024:512!sha512:1024:512!sha512:1024:512!sha512:1024:512!5!vnRy+2SrSA0fHt3dwhTP5g==!AVnwfZsAQjn+gULv7FSGjA==!xvHUX3WcpkeSn1lvjWcvBg==!It+OC/N9tu+d3ByHhuB0BQ==!Tb.gqUOiD.aWktVwHM.Q/O!7CcyMfXUPky5ptyATJsR2nq3vUqtnBC', 'testPassword123' ),
                );
-               /** @codingStandardsIgnoreEnd */
+               // @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
        }
 }