Merge "API: Update api-help-datatypes for Timestamp library changes"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 21 Jun 2019 06:07:33 +0000 (06:07 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 21 Jun 2019 06:07:33 +0000 (06:07 +0000)
24 files changed:
RELEASE-NOTES-1.34
includes/DefaultSettings.php
includes/GlobalFunctions.php
includes/OutputPage.php
includes/api/ApiPageSet.php
includes/api/ApiQueryBase.php
includes/block/BlockManager.php
includes/block/DatabaseBlock.php
includes/config/ServiceOptions.php
includes/installer/WebInstallerOutput.php
includes/parser/Parser.php
includes/parser/ParserOptions.php
languages/i18n/en.json
maintenance/convertUserOptions.php
maintenance/namespaceDupes.php
maintenance/populateContentTables.php
maintenance/purgeChangedPages.php
maintenance/sql.php
maintenance/userDupes.inc
resources/src/startup/startup.js
tests/phpunit/includes/block/BlockManagerTest.php
tests/phpunit/structure/ResourcesTest.php
tests/qunit/data/load.mock.php
tests/qunit/data/styleTest.css.php

index f3526d4..21e909c 100644 (file)
@@ -156,9 +156,10 @@ because of Phabricator reports.
 * User::makeGroupLinkWiki(), deprecated in 1.29, has been removed. Use
   UserGroupMembership::getLink() instead.
 * SavepointPostgres, deprecated in 1.31, has been removed.
-* Output::sectionEditLinksEnabled(), ParserOutput::getEditSectionTokens,
-  ::getTOCEnabled, ::setEditSectionTokens, ::setTOCEnabled, deprecated in 1.31,
-  have been removed.
+* OutputPage::enableSectionEditLinks(), OutputPage::sectionEditLinksEnabled(),
+  ParserOptions::getEditSection(), ParserOptions::setEditSection(), and
+  ParserOutput::getEditSectionTokens, ::getTOCEnabled, ::setEditSectionTokens,
+  and ::setTOCEnabled, deprecated in 1.31, have been removed.
 * EditPage::safeUnicodeInput() and ::safeUnicodeOutput(), deprecated in 1.30,
   have been removed.
 * Four methods in OutputPage, deprecated in 1.32, have been removed. You should
@@ -220,6 +221,12 @@ because of Phabricator reports.
   removed.
 * The $wgUseKeyHeader configuration option and the OutputPage::getKeyHeader()
   method, deprecated in 1.32, have been removed.
+* WebInstallerOutput::addWikiText(), deprecated in 1.32, has been removed.
+* Parser::fetchFile(), deprecated in 1.32, has been removed. Use the method
+  Parser::fetchFileAndTitle() instead.
+* The global function wfBCP47, deprecated in 1.31, has been removed.
+* wfCountDown() function, deprecated in 1.31, has been removed. Use
+  \Maintenance::countDown() method instead.
 * …
 
 === Deprecations in 1.34 ===
index c5a2f77..2075432 100644 (file)
@@ -4142,8 +4142,7 @@ $wgInvalidRedirectTargets = [ 'Filepath', 'Mypage', 'Mytalk', 'Redirect' ];
  *                    temporary storage. Preprocessor_DOM generally uses less memory;
  *                    the speed of the two is roughly the same.
  *
- *                    If this parameter is not given, it uses Preprocessor_DOM if the
- *                    DOM module is available, otherwise it uses Preprocessor_Hash.
+ *                    If this parameter is not given, it uses Preprocessor_Hash.
  *
  * The Preprocessor_DOM class is deprecated, and will be removed in a future
  * release.
index 759732f..c3829be 100644 (file)
@@ -2762,30 +2762,6 @@ function wfWaitForSlaves(
        return $lbFactory->waitForReplication( $opts );
 }
 
-/**
- * Count down from $seconds to zero on the terminal, with a one-second pause
- * between showing each number. For use in command-line scripts.
- *
- * @deprecated since 1.31, use Maintenance::countDown()
- *
- * @codeCoverageIgnore
- * @param int $seconds
- */
-function wfCountDown( $seconds ) {
-       wfDeprecated( __FUNCTION__, '1.31' );
-       for ( $i = $seconds; $i >= 0; $i-- ) {
-               if ( $i != $seconds ) {
-                       echo str_repeat( "\x08", strlen( $i + 1 ) );
-               }
-               echo $i;
-               flush();
-               if ( $i ) {
-                       sleep( 1 );
-               }
-       }
-       echo "\n";
-}
-
 /**
  * Replace all invalid characters with '-'.
  * Additional characters can be defined in $wgIllegalFileChars (see T22489).
@@ -2885,21 +2861,6 @@ function wfShorthandToInteger( $string = '', $default = -1 ) {
        return $val;
 }
 
-/**
- * Get the normalised IETF language tag
- * See unit test for examples.
- * See mediawiki.language.bcp47 for the JavaScript implementation.
- *
- * @deprecated since 1.31, use LanguageCode::bcp47() directly.
- *
- * @param string $code The language code.
- * @return string The language code which complying with BCP 47 standards.
- */
-function wfBCP47( $code ) {
-       wfDeprecated( __METHOD__, '1.31' );
-       return LanguageCode::bcp47( $code );
-}
-
 /**
  * Get a specific cache object.
  *
index fba75ec..6c49696 100644 (file)
@@ -4017,16 +4017,6 @@ class OutputPage extends ContextSource {
                return $this->mEnableTOC;
        }
 
-       /**
-        * Enables/disables section edit links, doesn't override __NOEDITSECTION__
-        * @param bool $flag
-        * @since 1.23
-        * @deprecated since 1.31, use $poOptions to addParserOutput() instead.
-        */
-       public function enableSectionEditLinks( $flag = true ) {
-               wfDeprecated( __METHOD__, '1.31' );
-       }
-
        /**
         * Helper function to setup the PHP implementation of OOUI to use in this request.
         *
index 64c6f45..6b24b63 100644 (file)
@@ -20,7 +20,7 @@
  * @file
  */
 use MediaWiki\MediaWikiServices;
-use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IResultWrapper;
 use Wikimedia\Rdbms\IDatabase;
 
 /**
@@ -735,7 +735,7 @@ class ApiPageSet extends ApiBase {
         * $this->getPageTableFields().
         *
         * @param IDatabase $db
-        * @param ResultWrapper $queryResult
+        * @param IResultWrapper $queryResult
         */
        public function populateFromQueryResult( $db, $queryResult ) {
                $this->initFromQueryResult( $queryResult );
@@ -854,7 +854,7 @@ class ApiPageSet extends ApiBase {
        /**
         * Iterate through the result of the query on 'page' table,
         * and for each row create and store title object and save any extra fields requested.
-        * @param ResultWrapper $res DB Query result
+        * @param IResultWrapper $res DB Query result
         * @param array $remaining Array of either pageID or ns/title elements (optional).
         *        If given, any missing items will go to $mMissingPageIDs and $mMissingTitles
         * @param bool $processTitles Must be provided together with $remaining.
index 59ec4f6..ec432d8 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 use Wikimedia\Rdbms\IDatabase;
-use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IResultWrapper;
 
 /**
  * This is a base class for all Query modules.
@@ -368,7 +368,7 @@ abstract class ApiQueryBase extends ApiBase {
         * @param array|null &$hookData If set, the ApiQueryBaseBeforeQuery and
         *  ApiQueryBaseAfterQuery hooks will be called, and the
         *  ApiQueryBaseProcessRow hook will be expected.
-        * @return ResultWrapper
+        * @return IResultWrapper
         */
        protected function select( $method, $extraQuery = [], array &$hookData = null ) {
                $tables = array_merge(
index 41ff893..abd2db2 100644 (file)
@@ -223,25 +223,32 @@ class BlockManager {
        }
 
        /**
-        * Given a list of blocks, return a list blocks where each block either has a
-        * unique ID or has ID null.
+        * Given a list of blocks, return a list of unique blocks.
+        *
+        * This usually means that each block has a unique ID. For a block with ID null,
+        * if it's an autoblock, it will be filtered out if the parent block is present;
+        * if not, it is assumed to be a unique system block, and kept.
         *
         * @param AbstractBlock[] $blocks
         * @return AbstractBlock[]
         */
        private function getUniqueBlocks( $blocks ) {
-               $blockIds = [];
-               $uniqueBlocks = [];
+               $systemBlocks = [];
+               $databaseBlocks = [];
+
                foreach ( $blocks as $block ) {
-                       $id = $block->getId();
-                       if ( $id === null ) {
-                               $uniqueBlocks[] = $block;
-                       } elseif ( !isset( $blockIds[$id] ) ) {
-                               $uniqueBlocks[] = $block;
-                               $blockIds[$block->getId()] = true;
+                       if ( $block instanceof SystemBlock ) {
+                               $systemBlocks[] = $block;
+                       } elseif ( $block->getType() === DatabaseBlock::TYPE_AUTO ) {
+                               if ( !isset( $databaseBlocks[$block->getParentBlockId()] ) ) {
+                                       $databaseBlocks[$block->getParentBlockId()] = $block;
+                               }
+                       } else {
+                               $databaseBlocks[$block->getId()] = $block;
                        }
                }
-               return $uniqueBlocks;
+
+               return array_merge( $systemBlocks, $databaseBlocks );
        }
 
        /**
index ba08d54..0f19324 100644 (file)
@@ -1045,6 +1045,14 @@ class DatabaseBlock extends AbstractBlock {
                return $this;
        }
 
+       /**
+        * @since 1.34
+        * @return int|null If this is an autoblock, ID of the parent block; otherwise null
+        */
+       public function getParentBlockId() {
+               return $this->mParentBlockId;
+       }
+
        /**
         * Get/set a flag determining whether the master is used for reads
         *
index 0f3743f..6ae059e 100644 (file)
@@ -23,6 +23,7 @@ use Wikimedia\Assert\Assert;
  * @since 1.34
  */
 class ServiceOptions {
+       private $keys = [];
        private $options = [];
 
        /**
@@ -33,6 +34,7 @@ class ServiceOptions {
         * @throws InvalidArgumentException if one of $keys is not found in any of $sources
         */
        public function __construct( array $keys, ...$sources ) {
+               $this->keys = $keys;
                foreach ( $keys as $key ) {
                        foreach ( $sources as $source ) {
                                if ( $source instanceof Config ) {
@@ -58,20 +60,21 @@ class ServiceOptions {
         * @param string[] $expectedKeys
         */
        public function assertRequiredOptions( array $expectedKeys ) {
-               $actualKeys = array_keys( $this->options );
-               $extraKeys = array_diff( $actualKeys, $expectedKeys );
-               $missingKeys = array_diff( $expectedKeys, $actualKeys );
-               Assert::precondition( !$extraKeys && !$missingKeys,
-                       (
-                       $extraKeys
-                               ? 'Unsupported options passed: ' . implode( ', ', $extraKeys ) . '!'
-                               : ''
-                       ) . ( $extraKeys && $missingKeys ? ' ' : '' ) . (
-                       $missingKeys
-                               ? 'Required options missing: ' . implode( ', ', $missingKeys ) . '!'
-                               : ''
-                       )
-               );
+               if ( $this->keys !== $expectedKeys ) {
+                       $extraKeys = array_diff( $this->keys, $expectedKeys );
+                       $missingKeys = array_diff( $expectedKeys, $this->keys );
+                       Assert::precondition( !$extraKeys && !$missingKeys,
+                               (
+                               $extraKeys
+                                       ? 'Unsupported options passed: ' . implode( ', ', $extraKeys ) . '!'
+                                       : ''
+                               ) . ( $extraKeys && $missingKeys ? ' ' : '' ) . (
+                               $missingKeys
+                                       ? 'Required options missing: ' . implode( ', ', $missingKeys ) . '!'
+                                       : ''
+                               )
+                       );
+               }
        }
 
        /**
index 65e7457..cbb9b57 100644 (file)
@@ -90,15 +90,6 @@ class WebInstallerOutput {
                $this->flush();
        }
 
-       /**
-        * @param string $text
-        * @deprecated since 1.32; use addWikiTextAsInterface instead
-        */
-       public function addWikiText( $text ) {
-               wfDeprecated( __METHOD__, '1.32' );
-               $this->addWikiTextAsInterface( $text );
-       }
-
        /**
         * @param string $text
         * @since 1.32
index c61de38..59f2db4 100644 (file)
@@ -3836,19 +3836,6 @@ class Parser {
                        'deps' => $deps ];
        }
 
-       /**
-        * Fetch a file and its title and register a reference to it.
-        * If 'broken' is a key in $options then the file will appear as a broken thumbnail.
-        * @param Title $title
-        * @param array $options Array of options to RepoGroup::findFile
-        * @return File|bool
-        * @deprecated since 1.32, use fetchFileAndTitle instead
-        */
-       public function fetchFile( $title, $options = [] ) {
-               wfDeprecated( __METHOD__, '1.32' );
-               return $this->fetchFileAndTitle( $title, $options )[0];
-       }
-
        /**
         * Fetch a file and its title and register a reference to it.
         * If 'broken' is a key in $options then the file will appear as a broken thumbnail.
index 66b1612..afd6b2d 100644 (file)
@@ -913,27 +913,6 @@ class ParserOptions {
                return wfSetVar( $this->mTimestamp, $x );
        }
 
-       /**
-        * Create "edit section" links?
-        * @deprecated since 1.31, use ParserOutput::getText() options instead.
-        * @return bool
-        */
-       public function getEditSection() {
-               wfDeprecated( __METHOD__, '1.31' );
-               return true;
-       }
-
-       /**
-        * Create "edit section" links?
-        * @deprecated since 1.31, use ParserOutput::getText() options instead.
-        * @param bool|null $x New value (null is no change)
-        * @return bool Old value
-        */
-       public function setEditSection( $x ) {
-               wfDeprecated( __METHOD__, '1.31' );
-               return true;
-       }
-
        /**
         * Set the redirect target.
         *
index 4c32ec6..425cf2b 100644 (file)
        "history": "Page history",
        "history_short": "History",
        "history_small": "history",
-       "updatedmarker": "updated since my last visit",
+       "updatedmarker": "updated since your last visit",
        "printableversion": "Printable version",
        "permalink": "Permanent link",
        "print": "Print",
index c1a096f..2cb3770 100644 (file)
@@ -23,7 +23,7 @@
 
 require_once __DIR__ . '/Maintenance.php';
 
-use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IResultWrapper;
 use Wikimedia\Rdbms\IDatabase;
 
 /**
@@ -76,7 +76,7 @@ class ConvertUserOptions extends Maintenance {
        }
 
        /**
-        * @param ResultWrapper $res
+        * @param IResultWrapper $res
         * @param IDatabase $dbw
         * @return null|int
         */
index 3c73306..333b8b9 100644 (file)
@@ -28,7 +28,7 @@ require_once __DIR__ . '/Maintenance.php';
 
 use MediaWiki\Linker\LinkTarget;
 use MediaWiki\MediaWikiServices;
-use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IResultWrapper;
 use Wikimedia\Rdbms\IMaintainableDatabase;
 
 /**
@@ -429,7 +429,7 @@ class NamespaceDupes extends Maintenance {
         * @param string $name Prefix that is being made a namespace
         * @param array $options Associative array of validated command-line options
         *
-        * @return ResultWrapper
+        * @return IResultWrapper
         */
        private function getTargetList( $ns, $name, $options ) {
                if (
index a264545..f3e373a 100644 (file)
@@ -25,7 +25,7 @@ use MediaWiki\Storage\NameTableStore;
 use MediaWiki\Storage\SqlBlobStore;
 use Wikimedia\Assert\Assert;
 use Wikimedia\Rdbms\IDatabase;
-use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IResultWrapper;
 
 require_once __DIR__ . '/Maintenance.php';
 
@@ -239,12 +239,12 @@ class PopulateContentTables extends Maintenance {
        }
 
        /**
-        * @param ResultWrapper $rows
+        * @param IResultWrapper $rows
         * @param int $startId
         * @param string $table
         * @return int|null
         */
-       private function populateContentTablesForRowBatch( ResultWrapper $rows, $startId, $table ) {
+       private function populateContentTablesForRowBatch( IResultWrapper $rows, $startId, $table ) {
                $this->beginTransaction( $this->dbw, __METHOD__ );
 
                if ( $this->contentRowMap === null ) {
index 8f47b16..8ecd810 100644 (file)
@@ -23,7 +23,7 @@
 
 require_once __DIR__ . '/Maintenance.php';
 
-use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IResultWrapper;
 
 /**
  * Maintenance script that sends purge requests for pages edited in a date
@@ -163,12 +163,12 @@ class PurgeChangedPages extends Maintenance {
         *
         * @todo move this elsewhere
         *
-        * @param ResultWrapper $res Query result sorted by $column (ascending)
+        * @param IResultWrapper $res Query result sorted by $column (ascending)
         * @param string $column
         * @param int $limit
         * @return array (array of rows, string column value)
         */
-       protected function pageableSortedRows( ResultWrapper $res, $column, $limit ) {
+       protected function pageableSortedRows( IResultWrapper $res, $column, $limit ) {
                $rows = iterator_to_array( $res, false );
 
                // Nothing to do
index 6a4cf04..3b0607f 100644 (file)
@@ -25,7 +25,7 @@
 require_once __DIR__ . '/Maintenance.php';
 
 use MediaWiki\MediaWikiServices;
-use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IResultWrapper;
 use Wikimedia\Rdbms\IDatabase;
 use Wikimedia\Rdbms\DBQueryError;
 
@@ -186,7 +186,7 @@ class MwSql extends Maintenance {
 
        /**
         * Print the results, callback for $db->sourceStream()
-        * @param ResultWrapper|bool $res
+        * @param IResultWrapper|bool $res
         * @param IDatabase $db
         * @return int|null Number of rows selected or updated, or null if the query was unsuccessful.
         */
index 257c6be..f759c13 100644 (file)
@@ -24,6 +24,8 @@
  * @ingroup Maintenance
  */
 
+use Wikimedia\Rdbms\IMaintainableDatabase;
+
 /**
  * Look for duplicate user table entries and optionally prune them.
  *
  * @ingroup Maintenance
  */
 class UserDupes {
+       /**
+        * @var IMaintainableDatabase
+        */
        private $db;
        private $reassigned;
        private $trimmed;
        private $failed;
        private $outputCallback;
 
-       function __construct( &$database, $outputCallback ) {
+       /**
+        * UserDupes constructor.
+        * @param IMaintainableDatabase &$database
+        * @param callback $outputCallback
+        */
+       public function __construct( &$database, $outputCallback ) {
                $this->db = $database;
                $this->outputCallback = $outputCallback;
        }
@@ -57,7 +67,7 @@ class UserDupes {
         * user_name index applied.
         * @return bool
         */
-       function hasUniqueIndex() {
+       public function hasUniqueIndex() {
                $info = $this->db->indexInfo( 'user', 'user_name', __METHOD__ );
                if ( !$info ) {
                        $this->out( "WARNING: doesn't seem to have user_name index at all!\n" );
@@ -82,7 +92,7 @@ class UserDupes {
         *
         * @return bool
         */
-       function clearDupes() {
+       public function clearDupes() {
                return $this->checkDupes( true );
        }
 
@@ -100,7 +110,7 @@ class UserDupes {
         *   from the database; false to just check.
         * @return bool
         */
-       function checkDupes( $doDelete = false ) {
+       private function checkDupes( $doDelete = false ) {
                if ( $this->hasUniqueIndex() ) {
                        echo wfWikiID() . " already has a unique index on its user table.\n";
 
@@ -163,9 +173,8 @@ class UserDupes {
 
        /**
         * We don't want anybody to mess with our stuff...
-        * @private
         */
-       function lock() {
+       private function lock() {
                $set = [ 'user', 'revision' ];
                $names = array_map( [ $this, 'lockTable' ], $set );
                $tables = implode( ',', $names );
@@ -173,23 +182,22 @@ class UserDupes {
                $this->db->query( "LOCK TABLES $tables", __METHOD__ );
        }
 
-       function lockTable( $table ) {
+       private function lockTable( $table ) {
                return $this->db->tableName( $table ) . ' WRITE';
        }
 
        /**
         * @private
         */
-       function unlock() {
+       private function unlock() {
                $this->db->query( "UNLOCK TABLES", __METHOD__ );
        }
 
        /**
         * Grab usernames for which multiple records are present in the database.
         * @return array
-        * @private
         */
-       function getDupes() {
+       private function getDupes() {
                $user = $this->db->tableName( 'user' );
                $result = $this->db->query(
                        "SELECT user_name,COUNT(*) AS n
@@ -211,9 +219,8 @@ class UserDupes {
         * for edits. If the dupes have no edits, we can safely remove them.
         * @param string $name
         * @param bool $doDelete
-        * @private
         */
-       function examine( $name, $doDelete ) {
+       private function examine( $name, $doDelete ) {
                $result = $this->db->select( 'user',
                        [ 'user_id' ],
                        [ 'user_name' => $name ],
@@ -260,9 +267,8 @@ class UserDupes {
         * where it might show up...
         * @param int $userid
         * @return int
-        * @private
         */
-       function editCount( $userid ) {
+       private function editCount( $userid ) {
                return intval( $this->db->selectField(
                        'revision',
                        'COUNT(*)',
@@ -273,9 +279,8 @@ class UserDupes {
        /**
         * @param int $from
         * @param int $to
-        * @private
         */
-       function reassignEdits( $from, $to ) {
+       private function reassignEdits( $from, $to ) {
                $this->out( 'reassigning... ' );
                $this->db->update( 'revision',
                        [ 'rev_user' => $to ],
@@ -287,9 +292,8 @@ class UserDupes {
        /**
         * Remove a user account line.
         * @param int $userid
-        * @private
         */
-       function trimAccount( $userid ) {
+       private function trimAccount( $userid ) {
                $this->out( "deleting..." );
                $this->db->delete( 'user', [ 'user_id' => $userid ], __METHOD__ );
                $this->out( " ok" );
index c251a86..da048ff 100644 (file)
@@ -74,7 +74,7 @@ function isCompatible( ua ) {
                //
                // Please extend the regex instead of adding new ones!
                // And add a test case to startup.test.js
-               !ua.match( /MSIE 10|webOS\/1\.[0-4]|SymbianOS|Series60|NetFront|Opera Mini|S40OviBrowser|MeeGo|Android.+Glass|^Mozilla\/5\.0 .+ Gecko\/$|googleweblight|PLAYSTATION|PlayStation/ )
+               !ua.match( /MSIE 10|webOS\/1\.[0-4]|SymbianOS|NetFront|Opera Mini|S40OviBrowser|MeeGo|Android.+Glass|^Mozilla\/5\.0 .+ Gecko\/$|googleweblight|PLAYSTATION|PlayStation/ )
        );
 }
 
index 39a5534..40fe4c8 100644 (file)
@@ -2,6 +2,7 @@
 
 use MediaWiki\Block\BlockManager;
 use MediaWiki\Block\DatabaseBlock;
+use MediaWiki\Block\SystemBlock;
 
 /**
  * @group Blocking
@@ -288,4 +289,38 @@ class BlockManagerTest extends MediaWikiTestCase {
                        ],
                ];
        }
+
+       /**
+        * @covers ::getUniqueBlocks
+        */
+       public function testGetUniqueBlocks() {
+               $blockId = 100;
+
+               $class = new ReflectionClass( BlockManager::class );
+               $method = $class->getMethod( 'getUniqueBlocks' );
+               $method->setAccessible( true );
+
+               $blockManager = $this->getBlockManager( [] );
+
+               $block = $this->getMockBuilder( DatabaseBlock::class )
+                       ->setMethods( [ 'getId' ] )
+                       ->getMock();
+               $block->expects( $this->any() )
+                       ->method( 'getId' )
+                       ->willReturn( $blockId );
+
+               $autoblock = $this->getMockBuilder( DatabaseBlock::class )
+                       ->setMethods( [ 'getParentBlockId', 'getType' ] )
+                       ->getMock();
+               $autoblock->expects( $this->any() )
+                       ->method( 'getParentBlockId' )
+                       ->willReturn( $blockId );
+               $autoblock->expects( $this->any() )
+                       ->method( 'getType' )
+                       ->willReturn( DatabaseBlock::TYPE_AUTO );
+
+               $blocks = [ $block, $block, $autoblock, new SystemBlock() ];
+
+               $this->assertSame( 2, count( $method->invoke( $blockManager, $blocks ) ) );
+       }
 }
index 4c34208..78e5763 100644 (file)
@@ -9,11 +9,9 @@ use Wikimedia\TestingAccessWrapper;
  * @author Antoine Musso
  * @author Niklas Laxström
  * @author Santhosh Thottingal
- * @author Timo Tijhof
  * @copyright © 2012, Antoine Musso
  * @copyright © 2012, Niklas Laxström
  * @copyright © 2012, Santhosh Thottingal
- * @copyright © 2012, Timo Tijhof
  */
 class ResourcesTest extends MediaWikiTestCase {
 
index 9f57190..1525f04 100644 (file)
@@ -18,9 +18,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  *
  * @file
- * @package MediaWiki
  * @author Lupo
- * @since 1.20
  */
 
 // This file doesn't run as part of MediaWiki
index db96fd5..5d229a3 100644 (file)
@@ -18,9 +18,6 @@
  * http://www.gnu.org/copyleft/gpl.html
  *
  * @file
- * @package MediaWiki
- * @author Timo Tijhof
- * @since 1.20
  */
 
 // This file doesn't run as part of MediaWiki