From 63d96c15fde8d4d2842aa50c5ed2ce594aa0c674 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sat, 17 Feb 2018 13:29:13 +0100 Subject: [PATCH] build: Updating mediawiki/mediawiki-codesniffer to 16.0.0 Change-Id: I59b59f79bbf3ce4feff3b3a20c1c31bc16370531 --- .phpcs.xml | 3 ++- composer.json | 2 +- includes/Message.php | 2 +- includes/api/ApiBase.php | 6 +++--- includes/api/ApiMain.php | 2 +- includes/auth/AuthPluginPrimaryAuthenticationProvider.php | 2 +- includes/parser/ParserOptions.php | 4 ++-- includes/skins/QuickTemplate.php | 2 +- includes/user/ExternalUserNames.php | 2 +- maintenance/checkLess.php | 2 +- maintenance/cleanupUsersWithNoId.php | 2 +- maintenance/migrateComments.php | 2 +- tests/integration/includes/http/MWHttpRequestTestCase.php | 2 +- tests/integration/includes/shell/FirejailCommandTest.php | 2 +- tests/parser/ParserTestRunner.php | 2 +- tests/parser/PhpunitTestRecorder.php | 2 +- tests/phpunit/MediaWikiPHPUnitTestListener.php | 2 +- tests/phpunit/MediaWikiTestCase.php | 2 +- tests/phpunit/includes/FauxRequestTest.php | 2 +- .../phpunit/includes/GlobalFunctions/wfArrayFilterTest.php | 2 +- tests/phpunit/includes/MediaWikiVersionFetcherTest.php | 2 +- tests/phpunit/includes/SanitizerValidateEmailTest.php | 2 +- tests/phpunit/includes/TitleArrayFromResultTest.php | 2 +- tests/phpunit/includes/WikiReferenceTest.php | 2 +- tests/phpunit/includes/XmlJsTest.php | 2 +- tests/phpunit/includes/api/ApiPageSetTest.php | 2 +- .../phpunit/includes/api/query/ApiQueryContinueTestBase.php | 2 +- ...EmailNotificationSecondaryAuthenticationProviderTest.php | 2 +- .../includes/composer/ComposerVersionNormalizerTest.php | 2 +- tests/phpunit/includes/config/EtcdConfigTest.php | 2 +- .../includes/debug/logger/monolog/LogstashFormatterTest.php | 2 +- tests/phpunit/includes/deferred/MWCallableUpdateTest.php | 2 +- .../deferred/TransactionRoundDefiningUpdateTest.php | 2 +- .../includes/externalstore/ExternalStoreFactoryTest.php | 2 +- .../phpunit/includes/htmlform/HTMLRestrictionsFieldTest.php | 2 +- tests/phpunit/includes/jobqueue/JobQueueMemoryTest.php | 2 +- tests/phpunit/includes/libs/ArrayUtilsTest.php | 2 +- tests/phpunit/includes/libs/DeferredStringifierTest.php | 2 +- tests/phpunit/includes/libs/DnsSrvDiscovererTest.php | 2 +- tests/phpunit/includes/libs/GenericArrayObjectTest.php | 2 +- tests/phpunit/includes/libs/HashRingTest.php | 2 +- tests/phpunit/includes/libs/HtmlArmorTest.php | 2 +- tests/phpunit/includes/libs/IEUrlExtensionTest.php | 2 +- tests/phpunit/includes/libs/IPTest.php | 2 +- tests/phpunit/includes/libs/JavaScriptMinifierTest.php | 2 +- tests/phpunit/includes/libs/MWMessagePackTest.php | 2 +- tests/phpunit/includes/libs/MapCacheLRUTest.php | 2 +- tests/phpunit/includes/libs/MemoizedCallableTest.php | 2 +- tests/phpunit/includes/libs/ProcessCacheLRUTest.php | 2 +- tests/phpunit/includes/libs/SamplingStatsdClientTest.php | 2 +- tests/phpunit/includes/libs/StringUtilsTest.php | 2 +- tests/phpunit/includes/libs/TimingTest.php | 2 +- tests/phpunit/includes/libs/XhprofDataTest.php | 2 +- tests/phpunit/includes/libs/XhprofTest.php | 2 +- tests/phpunit/includes/libs/XmlTypeCheckTest.php | 2 +- .../phpunit/includes/libs/http/HttpAcceptNegotiatorTest.php | 2 +- tests/phpunit/includes/libs/http/HttpAcceptParserTest.php | 2 +- tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php | 2 +- .../includes/libs/objectcache/CachedBagOStuffTest.php | 2 +- .../phpunit/includes/libs/objectcache/HashBagOStuffTest.php | 2 +- .../includes/libs/objectcache/WANObjectCacheTest.php | 2 +- .../phpunit/includes/libs/rdbms/TransactionProfilerTest.php | 2 +- .../libs/rdbms/connectionmanager/ConnectionManagerTest.php | 2 +- .../SessionConsistentConnectionManagerTest.php | 2 +- .../phpunit/includes/libs/rdbms/database/DBConnRefTest.php | 2 +- .../includes/libs/rdbms/database/DatabaseDomainTest.php | 2 +- .../includes/libs/rdbms/database/DatabaseMysqlBaseTest.php | 2 +- .../includes/libs/rdbms/database/DatabaseSQLTest.php | 2 +- tests/phpunit/includes/libs/rdbms/database/DatabaseTest.php | 2 +- tests/phpunit/includes/libs/xmp/XMPTest.php | 2 +- tests/phpunit/includes/libs/xmp/XMPValidateTest.php | 2 +- tests/phpunit/includes/objectcache/RedisBagOStuffTest.php | 2 +- tests/phpunit/includes/parser/ParserIntegrationTest.php | 2 +- tests/phpunit/includes/registration/VersionCheckerTest.php | 2 +- .../resourceloader/DerivativeResourceLoaderContextTest.php | 2 +- .../includes/resourceloader/MessageBlobStoreTest.php | 2 +- .../resourceloader/ResourceLoaderClientHtmlTest.php | 2 +- .../includes/resourceloader/ResourceLoaderContextTest.php | 2 +- .../resourceloader/ResourceLoaderSkinModuleTest.php | 2 +- tests/phpunit/includes/search/SearchSuggestionSetTest.php | 2 +- tests/phpunit/includes/services/ServiceContainerTest.php | 2 +- tests/phpunit/includes/shell/CommandFactoryTest.php | 2 +- tests/phpunit/includes/shell/CommandTest.php | 2 +- tests/phpunit/includes/shell/FirejailCommandTest.php | 2 +- tests/phpunit/includes/shell/ShellTest.php | 2 +- tests/phpunit/includes/site/FileBasedSiteLookupTest.php | 2 +- .../includes/site/MediaWikiPageNameNormalizerTest.php | 2 +- tests/phpunit/includes/site/SiteExporterTest.php | 2 +- tests/phpunit/includes/site/SiteImporterTest.php | 2 +- tests/phpunit/includes/site/SitesCacheFileBuilderTest.php | 2 +- tests/phpunit/includes/sparql/SparqlClientTest.php | 3 +-- tests/phpunit/includes/utils/AvroValidatorTest.php | 2 +- tests/phpunit/includes/utils/ClassCollectorTest.php | 2 +- tests/phpunit/includes/utils/FileContentsHasherTest.php | 2 +- tests/phpunit/includes/utils/MWCryptHashTest.php | 2 +- tests/phpunit/includes/utils/MWRestrictionsTest.php | 2 +- tests/phpunit/includes/utils/UIDGeneratorTest.php | 2 +- tests/phpunit/includes/utils/ZipDirectoryReaderTest.php | 2 +- .../watcheditem/WatchedItemQueryServiceUnitTest.php | 4 ++-- .../includes/watcheditem/WatchedItemStoreUnitTest.php | 4 ++-- tests/phpunit/languages/LanguageCodeTest.php | 2 +- tests/phpunit/maintenance/BenchmarkerTest.php | 3 +-- tests/phpunit/maintenance/fetchTextTest.php | 2 +- tests/phpunit/phpunit.php | 2 +- tests/phpunit/structure/AvailableRightsTest.php | 2 +- tests/phpunit/structure/ExtensionJsonValidationTest.php | 2 +- tests/phpunit/structure/StructureTest.php | 1 + 107 files changed, 113 insertions(+), 113 deletions(-) diff --git a/.phpcs.xml b/.phpcs.xml index 7f90f2788b..cd55428f63 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -7,7 +7,6 @@ - @@ -29,6 +28,8 @@ + + diff --git a/composer.json b/composer.json index 56d1633ef9..c96374feb4 100644 --- a/composer.json +++ b/composer.json @@ -55,7 +55,7 @@ "jakub-onderka/php-parallel-lint": "0.9.2", "jetbrains/phpstorm-stubs": "dev-master#1b9906084d6635456fcf3f3a01f0d7d5b99a578a", "justinrainbow/json-schema": "~5.2", - "mediawiki/mediawiki-codesniffer": "15.0.0", + "mediawiki/mediawiki-codesniffer": "16.0.0", "monolog/monolog": "~1.22.1", "nikic/php-parser": "3.1.3", "nmred/kafka-php": "0.1.5", diff --git a/includes/Message.php b/includes/Message.php index fac9a59893..7d05f41e86 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -1105,7 +1105,7 @@ class Message implements MessageSpecifier, Serializable { public static function listParam( array $list, $type = 'text' ) { if ( !isset( self::$listTypeMap[$type] ) ) { throw new InvalidArgumentException( - "Invalid type '$type'. Known types are: " . join( ', ', array_keys( self::$listTypeMap ) ) + "Invalid type '$type'. Known types are: " . implode( ', ', array_keys( self::$listTypeMap ) ) ); } return [ 'list' => $list, 'type' => $type ]; diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 62d73f480c..228d319f18 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -897,7 +897,7 @@ abstract class ApiBase extends ContextSource { if ( $badParams ) { $this->dieWithError( - [ 'apierror-mustpostparams', join( ', ', $badParams ), count( $badParams ) ] + [ 'apierror-mustpostparams', implode( ', ', $badParams ), count( $badParams ) ] ); } } @@ -1152,7 +1152,7 @@ abstract class ApiBase extends ContextSource { if ( $multi ) { // This loses the potential $wgContLang->checkTitleEncoding() transformation // done by WebRequest for $_GET. Let's call that a feature. - $value = join( "\x1f", $request->normalizeUnicode( explode( "\x1f", $rawValue ) ) ); + $value = implode( "\x1f", $request->normalizeUnicode( explode( "\x1f", $rawValue ) ) ); } else { $this->dieWithError( 'apierror-badvalue-notmultivalue', 'badvalue_notmultivalue' ); } @@ -1829,7 +1829,7 @@ abstract class ApiBase extends ContextSource { $msgs = [ $this->msg( 'api-usage-mailinglist-ref' ) ]; Hooks::run( 'ApiDeprecationHelp', [ &$msgs ] ); if ( count( $msgs ) > 1 ) { - $key = '$' . join( ' $', range( 1, count( $msgs ) ) ); + $key = '$' . implode( ' $', range( 1, count( $msgs ) ) ); $msg = ( new RawMessage( $key ) )->params( $msgs ); } else { $msg = reset( $msgs ); diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 008015b881..a7e3c1bd54 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -593,7 +593,7 @@ class ApiMain extends ApiBase { $this->setCacheMode( 'private' ); $response = $this->getRequest()->response(); - $headerStr = 'MediaWiki-API-Error: ' . join( ', ', $errCodes ); + $headerStr = 'MediaWiki-API-Error: ' . implode( ', ', $errCodes ); $response->header( $headerStr ); // Reset and print just the error message diff --git a/includes/auth/AuthPluginPrimaryAuthenticationProvider.php b/includes/auth/AuthPluginPrimaryAuthenticationProvider.php index b8e36bc4f3..cd0734d847 100644 --- a/includes/auth/AuthPluginPrimaryAuthenticationProvider.php +++ b/includes/auth/AuthPluginPrimaryAuthenticationProvider.php @@ -272,7 +272,7 @@ class AuthPluginPrimaryAuthenticationProvider if ( $failed ) { throw new \UnexpectedValueException( "AuthPlugin failed to reset password for $username in the following domains: " - . join( ' ', $failed ) + . implode( ' ', $failed ) ); } } diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index bbddbe2809..ff21ef0239 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -1254,7 +1254,7 @@ class ParserOptions { } elseif ( $value instanceof Language ) { return $value->getCode(); } elseif ( is_array( $value ) ) { - return '[' . join( ',', array_map( [ $this, 'optionToString' ], $value ) ) . ']'; + return '[' . implode( ',', array_map( [ $this, 'optionToString' ], $value ) ) . ']'; } else { return (string)$value; } @@ -1295,7 +1295,7 @@ class ParserOptions { } } - $confstr = $values ? join( '!', $values ) : 'canonical'; + $confstr = $values ? implode( '!', $values ) : 'canonical'; // add in language specific options, if any // @todo FIXME: This is just a way of retrieving the url/user preferred variant diff --git a/includes/skins/QuickTemplate.php b/includes/skins/QuickTemplate.php index e8466dc11f..1886746489 100644 --- a/includes/skins/QuickTemplate.php +++ b/includes/skins/QuickTemplate.php @@ -153,7 +153,7 @@ abstract class QuickTemplate { /** * An ugly, ugly hack. * @private - * @param string $str + * @param string $msgKey */ function msgWiki( $msgKey ) { global $wgOut; diff --git a/includes/user/ExternalUserNames.php b/includes/user/ExternalUserNames.php index 13ac6b2566..f039d04ec1 100644 --- a/includes/user/ExternalUserNames.php +++ b/includes/user/ExternalUserNames.php @@ -56,7 +56,7 @@ class ExternalUserNames { if ( $interwikiLookup->isValidInterwiki( $firstIw ) ) { $title = MWNamespace::getCanonicalName( NS_USER ) . ':' . substr( $userName, $pos + 1 ); if ( $iw ) { - $title = join( ':', $iw ) . ':' . $title; + $title = implode( ':', $iw ) . ':' . $title; } return Title::makeTitle( NS_MAIN, $title, '', $firstIw ); } diff --git a/maintenance/checkLess.php b/maintenance/checkLess.php index f001236a58..55ffcb838f 100644 --- a/maintenance/checkLess.php +++ b/maintenance/checkLess.php @@ -43,7 +43,7 @@ class CheckLess extends Maintenance { self::requireTestsAutoloader(); // If phpunit isn't available by autoloader try pulling it in - if ( !class_exists( 'PHPUnit_Framework_TestCase' ) ) { + if ( !class_exists( 'PHPUnit\\Framework\\TestCase' ) ) { require_once 'PHPUnit/Autoload.php'; } diff --git a/maintenance/cleanupUsersWithNoId.php b/maintenance/cleanupUsersWithNoId.php index 3763d3b1c1..b2fdf2f9c7 100644 --- a/maintenance/cleanupUsersWithNoId.php +++ b/maintenance/cleanupUsersWithNoId.php @@ -110,7 +110,7 @@ class CleanupUsersWithNoId extends LoggedUpdateMaintenance { $next = "$field > $value OR $field = $value AND ($next)"; } } - $display = join( ' ', array_reverse( $display ) ); + $display = implode( ' ', array_reverse( $display ) ); return [ $next, $display ]; } diff --git a/maintenance/migrateComments.php b/maintenance/migrateComments.php index c35315d71b..cb72c1ec2f 100644 --- a/maintenance/migrateComments.php +++ b/maintenance/migrateComments.php @@ -205,7 +205,7 @@ class MigrateComments extends LoggedUpdateMaintenance { $next = "$field > $value OR $field = $value AND ($next)"; } } - $prompt = join( ' ', array_reverse( $prompt ) ); + $prompt = implode( ' ', array_reverse( $prompt ) ); $this->output( "... $prompt\n" ); wfWaitForSlaves(); } diff --git a/tests/integration/includes/http/MWHttpRequestTestCase.php b/tests/integration/includes/http/MWHttpRequestTestCase.php index cc769d7ee8..262eb35080 100644 --- a/tests/integration/includes/http/MWHttpRequestTestCase.php +++ b/tests/integration/includes/http/MWHttpRequestTestCase.php @@ -2,7 +2,7 @@ use Wikimedia\TestingAccessWrapper; -abstract class MWHttpRequestTestCase extends PHPUnit_Framework_TestCase { +abstract class MWHttpRequestTestCase extends PHPUnit\Framework\TestCase { protected static $httpEngine; protected $oldHttpEngine; diff --git a/tests/integration/includes/shell/FirejailCommandTest.php b/tests/integration/includes/shell/FirejailCommandTest.php index 598c715ed7..c69fa730a3 100644 --- a/tests/integration/includes/shell/FirejailCommandTest.php +++ b/tests/integration/includes/shell/FirejailCommandTest.php @@ -9,7 +9,7 @@ use MediaWiki\Shell\Shell; * as long as firejail and sudo has similar config. * @group Shell */ -class FirejailCommandIntegrationTest extends PHPUnit_Framework_TestCase { +class FirejailCommandIntegrationTest extends PHPUnit\Framework\TestCase { public function setUp() { parent::setUp(); diff --git a/tests/parser/ParserTestRunner.php b/tests/parser/ParserTestRunner.php index 4dd4bc67d2..4f6f6b6758 100644 --- a/tests/parser/ParserTestRunner.php +++ b/tests/parser/ParserTestRunner.php @@ -889,7 +889,7 @@ class ParserTestRunner { if ( isset( $output ) && isset( $opts['showflags'] ) ) { $actualFlags = array_keys( TestingAccessWrapper::newFromObject( $output )->mFlags ); sort( $actualFlags ); - $out .= "\nflags=" . join( ', ', $actualFlags ); + $out .= "\nflags=" . implode( ', ', $actualFlags ); } ScopedCallback::consume( $teardownGuard ); diff --git a/tests/parser/PhpunitTestRecorder.php b/tests/parser/PhpunitTestRecorder.php index 2f82ca7267..1a2cfc918d 100644 --- a/tests/parser/PhpunitTestRecorder.php +++ b/tests/parser/PhpunitTestRecorder.php @@ -3,7 +3,7 @@ class PhpunitTestRecorder extends TestRecorder { private $testCase; - public function setTestCase( PHPUnit_Framework_TestCase $testCase ) { + public function setTestCase( PHPUnit\Framework\TestCase $testCase ) { $this->testCase = $testCase; } diff --git a/tests/phpunit/MediaWikiPHPUnitTestListener.php b/tests/phpunit/MediaWikiPHPUnitTestListener.php index dd606d8a4b..0a162a283d 100644 --- a/tests/phpunit/MediaWikiPHPUnitTestListener.php +++ b/tests/phpunit/MediaWikiPHPUnitTestListener.php @@ -11,7 +11,7 @@ class MediaWikiPHPUnitTestListener protected function getTestName( PHPUnit_Framework_Test $test ) { $name = get_class( $test ); - if ( $test instanceof PHPUnit_Framework_TestCase ) { + if ( $test instanceof PHPUnit\Framework\TestCase ) { $name .= '::' . $test->getName( true ); } diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 817f161504..652b1ee1bf 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -14,7 +14,7 @@ use Wikimedia\TestingAccessWrapper; /** * @since 1.18 */ -abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { +abstract class MediaWikiTestCase extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/FauxRequestTest.php b/tests/phpunit/includes/FauxRequestTest.php index f6ccbc78a8..9f8bb385f2 100644 --- a/tests/phpunit/includes/FauxRequestTest.php +++ b/tests/phpunit/includes/FauxRequestTest.php @@ -2,7 +2,7 @@ use MediaWiki\Session\SessionManager; -class FauxRequestTest extends PHPUnit_Framework_TestCase { +class FauxRequestTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/GlobalFunctions/wfArrayFilterTest.php b/tests/phpunit/includes/GlobalFunctions/wfArrayFilterTest.php index 8adb55fc14..1011a37c3e 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfArrayFilterTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfArrayFilterTest.php @@ -5,7 +5,7 @@ * @covers ::wfArrayFilter * @covers ::wfArrayFilterByKey */ -class WfArrayFilterTest extends \PHPUnit_Framework_TestCase { +class WfArrayFilterTest extends \PHPUnit\Framework\TestCase { public function testWfArrayFilter() { $arr = [ 'a' => 1, 'b' => 2, 'c' => 3 ]; $filtered = wfArrayFilter( $arr, function ( $val, $key ) { diff --git a/tests/phpunit/includes/MediaWikiVersionFetcherTest.php b/tests/phpunit/includes/MediaWikiVersionFetcherTest.php index 6aa98490e7..87a7dffde1 100644 --- a/tests/phpunit/includes/MediaWikiVersionFetcherTest.php +++ b/tests/phpunit/includes/MediaWikiVersionFetcherTest.php @@ -10,7 +10,7 @@ * * @author Jeroen De Dauw < jeroendedauw@gmail.com > */ -class MediaWikiVersionFetcherTest extends PHPUnit_Framework_TestCase { +class MediaWikiVersionFetcherTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/SanitizerValidateEmailTest.php b/tests/phpunit/includes/SanitizerValidateEmailTest.php index c7e15ea5d1..c4e430848b 100644 --- a/tests/phpunit/includes/SanitizerValidateEmailTest.php +++ b/tests/phpunit/includes/SanitizerValidateEmailTest.php @@ -5,7 +5,7 @@ * @todo all test methods in this class should be refactored and... * use a single test method and a single data provider... */ -class SanitizerValidateEmailTest extends PHPUnit_Framework_TestCase { +class SanitizerValidateEmailTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/TitleArrayFromResultTest.php b/tests/phpunit/includes/TitleArrayFromResultTest.php index 63956c123a..af49ecf73a 100644 --- a/tests/phpunit/includes/TitleArrayFromResultTest.php +++ b/tests/phpunit/includes/TitleArrayFromResultTest.php @@ -4,7 +4,7 @@ * @author Addshore * @covers TitleArrayFromResult */ -class TitleArrayFromResultTest extends PHPUnit_Framework_TestCase { +class TitleArrayFromResultTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/WikiReferenceTest.php b/tests/phpunit/includes/WikiReferenceTest.php index dc2e9ae412..e4b21ce5ac 100644 --- a/tests/phpunit/includes/WikiReferenceTest.php +++ b/tests/phpunit/includes/WikiReferenceTest.php @@ -3,7 +3,7 @@ /** * @covers WikiReference */ -class WikiReferenceTest extends PHPUnit_Framework_TestCase { +class WikiReferenceTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/XmlJsTest.php b/tests/phpunit/includes/XmlJsTest.php index dec7bf3d2a..c7975efabc 100644 --- a/tests/phpunit/includes/XmlJsTest.php +++ b/tests/phpunit/includes/XmlJsTest.php @@ -3,7 +3,7 @@ /** * @group Xml */ -class XmlJsTest extends PHPUnit_Framework_TestCase { +class XmlJsTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/api/ApiPageSetTest.php b/tests/phpunit/includes/api/ApiPageSetTest.php index 10bdfa735c..b9e4645d52 100644 --- a/tests/phpunit/includes/api/ApiPageSetTest.php +++ b/tests/phpunit/includes/api/ApiPageSetTest.php @@ -108,7 +108,7 @@ class ApiPageSetTest extends ApiTestCase { $userName = $user->getName(); $userDbkey = str_replace( ' ', '_', $userName ); $request = new FauxRequest( [ - 'titles' => join( '|', [ + 'titles' => implode( '|', [ 'Special:MyContributions', 'Special:MyPage', 'Special:MyTalk/subpage', diff --git a/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php b/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php index 2371eea87a..d2bdb496af 100644 --- a/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php +++ b/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php @@ -157,7 +157,7 @@ abstract class ApiQueryContinueTestBase extends ApiQueryTestBase { /** * Recursively merge the new result returned from the query to the previous results. - * @param mixed $results + * @param mixed &$results * @param mixed $newResult * @param bool $numericIds If true, treat keys as ids to be merged instead of appending */ diff --git a/tests/phpunit/includes/auth/EmailNotificationSecondaryAuthenticationProviderTest.php b/tests/phpunit/includes/auth/EmailNotificationSecondaryAuthenticationProviderTest.php index dd027937cc..1a7ed12da7 100644 --- a/tests/phpunit/includes/auth/EmailNotificationSecondaryAuthenticationProviderTest.php +++ b/tests/phpunit/includes/auth/EmailNotificationSecondaryAuthenticationProviderTest.php @@ -5,7 +5,7 @@ namespace MediaWiki\Auth; use Psr\Log\LoggerInterface; use Wikimedia\TestingAccessWrapper; -class EmailNotificationSecondaryAuthenticationProviderTest extends \PHPUnit_Framework_TestCase { +class EmailNotificationSecondaryAuthenticationProviderTest extends \PHPUnit\Framework\TestCase { public function testConstructor() { $config = new \HashConfig( [ 'EnableEmail' => true, diff --git a/tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php b/tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php index 9ade89248b..c607ae5b50 100644 --- a/tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php +++ b/tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php @@ -7,7 +7,7 @@ * * @author Jeroen De Dauw < jeroendedauw@gmail.com > */ -class ComposerVersionNormalizerTest extends PHPUnit_Framework_TestCase { +class ComposerVersionNormalizerTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/config/EtcdConfigTest.php b/tests/phpunit/includes/config/EtcdConfigTest.php index 379eebd8a4..c833934bfd 100644 --- a/tests/phpunit/includes/config/EtcdConfigTest.php +++ b/tests/phpunit/includes/config/EtcdConfigTest.php @@ -2,7 +2,7 @@ use Wikimedia\TestingAccessWrapper; -class EtcdConfigTest extends PHPUnit_Framework_TestCase { +class EtcdConfigTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/debug/logger/monolog/LogstashFormatterTest.php b/tests/phpunit/includes/debug/logger/monolog/LogstashFormatterTest.php index 8086b4bf23..1ee188e7cd 100644 --- a/tests/phpunit/includes/debug/logger/monolog/LogstashFormatterTest.php +++ b/tests/phpunit/includes/debug/logger/monolog/LogstashFormatterTest.php @@ -2,7 +2,7 @@ namespace MediaWiki\Logger\Monolog; -class LogstashFormatterTest extends \PHPUnit_Framework_TestCase { +class LogstashFormatterTest extends \PHPUnit\Framework\TestCase { /** * @dataProvider provideV1 * @param array $record The input record. diff --git a/tests/phpunit/includes/deferred/MWCallableUpdateTest.php b/tests/phpunit/includes/deferred/MWCallableUpdateTest.php index 6977aef1a2..3ab9b5659e 100644 --- a/tests/phpunit/includes/deferred/MWCallableUpdateTest.php +++ b/tests/phpunit/includes/deferred/MWCallableUpdateTest.php @@ -3,7 +3,7 @@ /** * @covers MWCallableUpdate */ -class MWCallableUpdateTest extends PHPUnit_Framework_TestCase { +class MWCallableUpdateTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/deferred/TransactionRoundDefiningUpdateTest.php b/tests/phpunit/includes/deferred/TransactionRoundDefiningUpdateTest.php index 1261c24b26..693897e676 100644 --- a/tests/phpunit/includes/deferred/TransactionRoundDefiningUpdateTest.php +++ b/tests/phpunit/includes/deferred/TransactionRoundDefiningUpdateTest.php @@ -3,7 +3,7 @@ /** * @covers TransactionRoundDefiningUpdate */ -class TransactionRoundDefiningUpdateTest extends PHPUnit_Framework_TestCase { +class TransactionRoundDefiningUpdateTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/externalstore/ExternalStoreFactoryTest.php b/tests/phpunit/includes/externalstore/ExternalStoreFactoryTest.php index d43e04a4aa..f762693864 100644 --- a/tests/phpunit/includes/externalstore/ExternalStoreFactoryTest.php +++ b/tests/phpunit/includes/externalstore/ExternalStoreFactoryTest.php @@ -3,7 +3,7 @@ /** * @covers ExternalStoreFactory */ -class ExternalStoreFactoryTest extends PHPUnit_Framework_TestCase { +class ExternalStoreFactoryTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/htmlform/HTMLRestrictionsFieldTest.php b/tests/phpunit/includes/htmlform/HTMLRestrictionsFieldTest.php index 75c93be698..c4290e1e64 100644 --- a/tests/phpunit/includes/htmlform/HTMLRestrictionsFieldTest.php +++ b/tests/phpunit/includes/htmlform/HTMLRestrictionsFieldTest.php @@ -3,7 +3,7 @@ /** * @covers HTMLRestrictionsField */ -class HTMLRestrictionsFieldTest extends PHPUnit_Framework_TestCase { +class HTMLRestrictionsFieldTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/jobqueue/JobQueueMemoryTest.php b/tests/phpunit/includes/jobqueue/JobQueueMemoryTest.php index d5a267e5b4..b5d6144242 100644 --- a/tests/phpunit/includes/jobqueue/JobQueueMemoryTest.php +++ b/tests/phpunit/includes/jobqueue/JobQueueMemoryTest.php @@ -8,7 +8,7 @@ * @licence GNU GPL v2+ * @author Thiemo Kreuz */ -class JobQueueMemoryTest extends PHPUnit_Framework_TestCase { +class JobQueueMemoryTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/ArrayUtilsTest.php b/tests/phpunit/includes/libs/ArrayUtilsTest.php index 88312657d4..4fbbc99b6a 100644 --- a/tests/phpunit/includes/libs/ArrayUtilsTest.php +++ b/tests/phpunit/includes/libs/ArrayUtilsTest.php @@ -4,7 +4,7 @@ * * @group Database */ -class ArrayUtilsTest extends PHPUnit_Framework_TestCase { +class ArrayUtilsTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/DeferredStringifierTest.php b/tests/phpunit/includes/libs/DeferredStringifierTest.php index c9958403f9..c9cdf5831d 100644 --- a/tests/phpunit/includes/libs/DeferredStringifierTest.php +++ b/tests/phpunit/includes/libs/DeferredStringifierTest.php @@ -3,7 +3,7 @@ /** * @covers DeferredStringifier */ -class DeferredStringifierTest extends PHPUnit_Framework_TestCase { +class DeferredStringifierTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/DnsSrvDiscovererTest.php b/tests/phpunit/includes/libs/DnsSrvDiscovererTest.php index 264cc00a7d..1b3397c12a 100644 --- a/tests/phpunit/includes/libs/DnsSrvDiscovererTest.php +++ b/tests/phpunit/includes/libs/DnsSrvDiscovererTest.php @@ -3,7 +3,7 @@ /** * @covers DnsSrvDiscoverer */ -class DnsSrvDiscovererTest extends PHPUnit_Framework_TestCase { +class DnsSrvDiscovererTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/GenericArrayObjectTest.php b/tests/phpunit/includes/libs/GenericArrayObjectTest.php index 3e8aaeba02..a7cf755329 100644 --- a/tests/phpunit/includes/libs/GenericArrayObjectTest.php +++ b/tests/phpunit/includes/libs/GenericArrayObjectTest.php @@ -26,7 +26,7 @@ * * @author Jeroen De Dauw < jeroendedauw@gmail.com > */ -abstract class GenericArrayObjectTest extends PHPUnit_Framework_TestCase { +abstract class GenericArrayObjectTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/HashRingTest.php b/tests/phpunit/includes/libs/HashRingTest.php index 040bebf4f0..ba288281f6 100644 --- a/tests/phpunit/includes/libs/HashRingTest.php +++ b/tests/phpunit/includes/libs/HashRingTest.php @@ -3,7 +3,7 @@ /** * @group HashRing */ -class HashRingTest extends PHPUnit_Framework_TestCase { +class HashRingTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/HtmlArmorTest.php b/tests/phpunit/includes/libs/HtmlArmorTest.php index eb601e7fc8..c5e87e4e2a 100644 --- a/tests/phpunit/includes/libs/HtmlArmorTest.php +++ b/tests/phpunit/includes/libs/HtmlArmorTest.php @@ -3,7 +3,7 @@ /** * @covers HtmlArmor */ -class HtmlArmorTest extends PHPUnit_Framework_TestCase { +class HtmlArmorTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/IEUrlExtensionTest.php b/tests/phpunit/includes/libs/IEUrlExtensionTest.php index 8192f01828..03c7b0c05c 100644 --- a/tests/phpunit/includes/libs/IEUrlExtensionTest.php +++ b/tests/phpunit/includes/libs/IEUrlExtensionTest.php @@ -5,7 +5,7 @@ * @todo tests below for findIE6Extension should be split into... * ...a dataprovider and test method. */ -class IEUrlExtensionTest extends PHPUnit_Framework_TestCase { +class IEUrlExtensionTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/IPTest.php b/tests/phpunit/includes/libs/IPTest.php index a36b259300..6a751816a6 100644 --- a/tests/phpunit/includes/libs/IPTest.php +++ b/tests/phpunit/includes/libs/IPTest.php @@ -8,7 +8,7 @@ * @todo Test methods in this call should be split into a method and a * dataprovider. */ -class IPTest extends PHPUnit_Framework_TestCase { +class IPTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php index 98494c4386..61056784fb 100644 --- a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php +++ b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php @@ -1,6 +1,6 @@ */ -class TimingTest extends PHPUnit_Framework_TestCase { +class TimingTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/XhprofDataTest.php b/tests/phpunit/includes/libs/XhprofDataTest.php index d226227b0b..1cbd86f1ef 100644 --- a/tests/phpunit/includes/libs/XhprofDataTest.php +++ b/tests/phpunit/includes/libs/XhprofDataTest.php @@ -24,7 +24,7 @@ * @copyright © 2014 Wikimedia Foundation and contributors * @since 1.25 */ -class XhprofDataTest extends PHPUnit_Framework_TestCase { +class XhprofDataTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/XhprofTest.php b/tests/phpunit/includes/libs/XhprofTest.php index e2723b9dc9..0ea132896d 100644 --- a/tests/phpunit/includes/libs/XhprofTest.php +++ b/tests/phpunit/includes/libs/XhprofTest.php @@ -18,7 +18,7 @@ * @file */ -class XhprofTest extends PHPUnit_Framework_TestCase { +class XhprofTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/XmlTypeCheckTest.php b/tests/phpunit/includes/libs/XmlTypeCheckTest.php index 8a11d874e2..8616b41922 100644 --- a/tests/phpunit/includes/libs/XmlTypeCheckTest.php +++ b/tests/phpunit/includes/libs/XmlTypeCheckTest.php @@ -5,7 +5,7 @@ * @group Xml * @covers XMLTypeCheck */ -class XmlTypeCheckTest extends PHPUnit_Framework_TestCase { +class XmlTypeCheckTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/http/HttpAcceptNegotiatorTest.php b/tests/phpunit/includes/libs/http/HttpAcceptNegotiatorTest.php index 10dca7dcf0..02eac11887 100644 --- a/tests/phpunit/includes/libs/http/HttpAcceptNegotiatorTest.php +++ b/tests/phpunit/includes/libs/http/HttpAcceptNegotiatorTest.php @@ -7,7 +7,7 @@ use Wikimedia\Http\HttpAcceptNegotiator; * * @author Daniel Kinzler */ -class HttpAcceptNegotiatorTest extends \PHPUnit_Framework_TestCase { +class HttpAcceptNegotiatorTest extends \PHPUnit\Framework\TestCase { public function provideGetFirstSupportedValue() { return [ diff --git a/tests/phpunit/includes/libs/http/HttpAcceptParserTest.php b/tests/phpunit/includes/libs/http/HttpAcceptParserTest.php index 788c297f05..e4b47b46d5 100644 --- a/tests/phpunit/includes/libs/http/HttpAcceptParserTest.php +++ b/tests/phpunit/includes/libs/http/HttpAcceptParserTest.php @@ -7,7 +7,7 @@ use Wikimedia\Http\HttpAcceptParser; * * @author Daniel Kinzler */ -class HttpAcceptParserTest extends \PHPUnit_Framework_TestCase { +class HttpAcceptParserTest extends \PHPUnit\Framework\TestCase { public function provideParseWeights() { return [ diff --git a/tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php b/tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php index 1f3cae5347..fbe5a2bada 100644 --- a/tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php +++ b/tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php @@ -3,7 +3,7 @@ * @group Media * @covers MimeAnalyzer */ -class MimeAnalyzerTest extends PHPUnit_Framework_TestCase { +class MimeAnalyzerTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/objectcache/CachedBagOStuffTest.php b/tests/phpunit/includes/libs/objectcache/CachedBagOStuffTest.php index d71b16c682..d0360a99f2 100644 --- a/tests/phpunit/includes/libs/objectcache/CachedBagOStuffTest.php +++ b/tests/phpunit/includes/libs/objectcache/CachedBagOStuffTest.php @@ -5,7 +5,7 @@ use Wikimedia\TestingAccessWrapper; /** * @group BagOStuff */ -class CachedBagOStuffTest extends PHPUnit_Framework_TestCase { +class CachedBagOStuffTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php b/tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php index 9eb34099e3..332e23b25b 100644 --- a/tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php +++ b/tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php @@ -5,7 +5,7 @@ use Wikimedia\TestingAccessWrapper; /** * @group BagOStuff */ -class HashBagOStuffTest extends PHPUnit_Framework_TestCase { +class HashBagOStuffTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php index ca78f6500c..77198f9d18 100644 --- a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php +++ b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php @@ -16,7 +16,7 @@ use Wikimedia\TestingAccessWrapper; * @covers WANObjectCache::getInterimValue * @covers WANObjectCache::setInterimValue */ -class WANObjectCacheTest extends PHPUnit_Framework_TestCase { +class WANObjectCacheTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php b/tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php index 25613fed6b..538d625cc2 100644 --- a/tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php +++ b/tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php @@ -6,7 +6,7 @@ use Psr\Log\LoggerInterface; /** * @covers \Wikimedia\Rdbms\TransactionProfiler */ -class TransactionProfilerTest extends PHPUnit_Framework_TestCase { +class TransactionProfilerTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/rdbms/connectionmanager/ConnectionManagerTest.php b/tests/phpunit/includes/libs/rdbms/connectionmanager/ConnectionManagerTest.php index 2a707d3968..dd86a73eca 100644 --- a/tests/phpunit/includes/libs/rdbms/connectionmanager/ConnectionManagerTest.php +++ b/tests/phpunit/includes/libs/rdbms/connectionmanager/ConnectionManagerTest.php @@ -12,7 +12,7 @@ use Wikimedia\Rdbms\ConnectionManager; * * @author Daniel Kinzler */ -class ConnectionManagerTest extends \PHPUnit_Framework_TestCase { +class ConnectionManagerTest extends \PHPUnit\Framework\TestCase { /** * @return IDatabase|PHPUnit_Framework_MockObject_MockObject diff --git a/tests/phpunit/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManagerTest.php b/tests/phpunit/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManagerTest.php index 20ce095c87..8d7d104c1e 100644 --- a/tests/phpunit/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManagerTest.php +++ b/tests/phpunit/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManagerTest.php @@ -12,7 +12,7 @@ use Wikimedia\Rdbms\SessionConsistentConnectionManager; * * @author Daniel Kinzler */ -class SessionConsistentConnectionManagerTest extends \PHPUnit_Framework_TestCase { +class SessionConsistentConnectionManagerTest extends \PHPUnit\Framework\TestCase { /** * @return IDatabase|PHPUnit_Framework_MockObject_MockObject diff --git a/tests/phpunit/includes/libs/rdbms/database/DBConnRefTest.php b/tests/phpunit/includes/libs/rdbms/database/DBConnRefTest.php index e660265125..d1f961a809 100644 --- a/tests/phpunit/includes/libs/rdbms/database/DBConnRefTest.php +++ b/tests/phpunit/includes/libs/rdbms/database/DBConnRefTest.php @@ -10,7 +10,7 @@ use Wikimedia\Rdbms\ResultWrapper; /** * @covers Wikimedia\Rdbms\DBConnRef */ -class DBConnRefTest extends PHPUnit_Framework_TestCase { +class DBConnRefTest extends PHPUnit\Framework\TestCase { /** * @return ILoadBalancer diff --git a/tests/phpunit/includes/libs/rdbms/database/DatabaseDomainTest.php b/tests/phpunit/includes/libs/rdbms/database/DatabaseDomainTest.php index 4e5f735b60..b13e8fca62 100644 --- a/tests/phpunit/includes/libs/rdbms/database/DatabaseDomainTest.php +++ b/tests/phpunit/includes/libs/rdbms/database/DatabaseDomainTest.php @@ -5,7 +5,7 @@ use Wikimedia\Rdbms\DatabaseDomain; /** * @covers Wikimedia\Rdbms\DatabaseDomain */ -class DatabaseDomainTest extends PHPUnit_Framework_TestCase { +class DatabaseDomainTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php b/tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php index ce067aaa33..9f8c11a1be 100644 --- a/tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php +++ b/tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php @@ -109,7 +109,7 @@ class FakeDatabaseMysqlBase extends DatabaseMysqlBase { } } -class DatabaseMysqlBaseTest extends PHPUnit_Framework_TestCase { +class DatabaseMysqlBaseTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php b/tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php index d8ebeff170..184d6260f8 100644 --- a/tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php +++ b/tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php @@ -6,7 +6,7 @@ use Wikimedia\Rdbms\LikeMatch; * Test the parts of the Database abstract class that deal * with creating SQL text. */ -class DatabaseSQLTest extends PHPUnit_Framework_TestCase { +class DatabaseSQLTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/rdbms/database/DatabaseTest.php b/tests/phpunit/includes/libs/rdbms/database/DatabaseTest.php index b42a3672df..542470d0a6 100644 --- a/tests/phpunit/includes/libs/rdbms/database/DatabaseTest.php +++ b/tests/phpunit/includes/libs/rdbms/database/DatabaseTest.php @@ -5,7 +5,7 @@ use Wikimedia\Rdbms\LBFactorySingle; use Wikimedia\Rdbms\TransactionProfiler; use Wikimedia\TestingAccessWrapper; -class DatabaseTest extends PHPUnit_Framework_TestCase { +class DatabaseTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/xmp/XMPTest.php b/tests/phpunit/includes/libs/xmp/XMPTest.php index 7becad2bb8..73fd47167c 100644 --- a/tests/phpunit/includes/libs/xmp/XMPTest.php +++ b/tests/phpunit/includes/libs/xmp/XMPTest.php @@ -4,7 +4,7 @@ * @group Media * @covers XMPReader */ -class XMPTest extends PHPUnit_Framework_TestCase { +class XMPTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/libs/xmp/XMPValidateTest.php b/tests/phpunit/includes/libs/xmp/XMPValidateTest.php index 0785920d44..746f68aca7 100644 --- a/tests/phpunit/includes/libs/xmp/XMPValidateTest.php +++ b/tests/phpunit/includes/libs/xmp/XMPValidateTest.php @@ -5,7 +5,7 @@ use Psr\Log\NullLogger; /** * @group Media */ -class XMPValidateTest extends PHPUnit_Framework_TestCase { +class XMPValidateTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/objectcache/RedisBagOStuffTest.php b/tests/phpunit/includes/objectcache/RedisBagOStuffTest.php index 6e8c9cee80..df5614d8c1 100644 --- a/tests/phpunit/includes/objectcache/RedisBagOStuffTest.php +++ b/tests/phpunit/includes/objectcache/RedisBagOStuffTest.php @@ -5,7 +5,7 @@ use Wikimedia\TestingAccessWrapper; /** * @group BagOStuff */ -class RedisBagOStuffTest extends PHPUnit_Framework_TestCase { +class RedisBagOStuffTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/parser/ParserIntegrationTest.php b/tests/phpunit/includes/parser/ParserIntegrationTest.php index 28430ad7cd..0e1605a944 100644 --- a/tests/phpunit/includes/parser/ParserIntegrationTest.php +++ b/tests/phpunit/includes/parser/ParserIntegrationTest.php @@ -26,7 +26,7 @@ use Wikimedia\ScopedCallback; * @covers ParserOptions * @covers ParserOutput */ -class ParserIntegrationTest extends PHPUnit_Framework_TestCase { +class ParserIntegrationTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/registration/VersionCheckerTest.php b/tests/phpunit/includes/registration/VersionCheckerTest.php index 4a2810bb58..929ff0fa62 100644 --- a/tests/phpunit/includes/registration/VersionCheckerTest.php +++ b/tests/phpunit/includes/registration/VersionCheckerTest.php @@ -3,7 +3,7 @@ /** * @covers VersionChecker */ -class VersionCheckerTest extends PHPUnit_Framework_TestCase { +class VersionCheckerTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php b/tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php index db1fb6452f..e4f58eb124 100644 --- a/tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php +++ b/tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php @@ -4,7 +4,7 @@ * @group ResourceLoader * @covers DerivativeResourceLoaderContext */ -class DerivativeResourceLoaderContextTest extends PHPUnit_Framework_TestCase { +class DerivativeResourceLoaderContextTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/resourceloader/MessageBlobStoreTest.php b/tests/phpunit/includes/resourceloader/MessageBlobStoreTest.php index c00432efe8..fa4d804ee8 100644 --- a/tests/phpunit/includes/resourceloader/MessageBlobStoreTest.php +++ b/tests/phpunit/includes/resourceloader/MessageBlobStoreTest.php @@ -6,7 +6,7 @@ use Wikimedia\TestingAccessWrapper; * @group Cache * @covers MessageBlobStore */ -class MessageBlobStoreTest extends PHPUnit_Framework_TestCase { +class MessageBlobStoreTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php index e51d0d6252..7bfd7698ea 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php @@ -5,7 +5,7 @@ use Wikimedia\TestingAccessWrapper; /** * @group ResourceLoader */ -class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase { +class ResourceLoaderClientHtmlTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderContextTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderContextTest.php index f848556a42..b226ee1caf 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderContextTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderContextTest.php @@ -8,7 +8,7 @@ * @group Cache * @covers ResourceLoaderContext */ -class ResourceLoaderContextTest extends PHPUnit_Framework_TestCase { +class ResourceLoaderContextTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php index 0718af6d8e..a1b1422060 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php @@ -3,7 +3,7 @@ /** * @group ResourceLoader */ -class ResourceLoaderSkinModuleTest extends PHPUnit_Framework_TestCase { +class ResourceLoaderSkinModuleTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/search/SearchSuggestionSetTest.php b/tests/phpunit/includes/search/SearchSuggestionSetTest.php index 28c69fa4b1..54533a7333 100644 --- a/tests/phpunit/includes/search/SearchSuggestionSetTest.php +++ b/tests/phpunit/includes/search/SearchSuggestionSetTest.php @@ -19,7 +19,7 @@ * http://www.gnu.org/copyleft/gpl.html */ -class SearchSuggestionSetTest extends \PHPUnit_Framework_TestCase { +class SearchSuggestionSetTest extends \PHPUnit\Framework\TestCase { /** * Test that adding a new suggestion at the end * will keep proper score ordering diff --git a/tests/phpunit/includes/services/ServiceContainerTest.php b/tests/phpunit/includes/services/ServiceContainerTest.php index 768ed9106f..1e8175e1b0 100644 --- a/tests/phpunit/includes/services/ServiceContainerTest.php +++ b/tests/phpunit/includes/services/ServiceContainerTest.php @@ -6,7 +6,7 @@ use MediaWiki\Services\ServiceContainer; * * @group MediaWiki */ -class ServiceContainerTest extends PHPUnit_Framework_TestCase { +class ServiceContainerTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/shell/CommandFactoryTest.php b/tests/phpunit/includes/shell/CommandFactoryTest.php index cb2669f8fc..b031431af7 100644 --- a/tests/phpunit/includes/shell/CommandFactoryTest.php +++ b/tests/phpunit/includes/shell/CommandFactoryTest.php @@ -9,7 +9,7 @@ use Wikimedia\TestingAccessWrapper; /** * @group Shell */ -class CommandFactoryTest extends PHPUnit_Framework_TestCase { +class CommandFactoryTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/shell/CommandTest.php b/tests/phpunit/includes/shell/CommandTest.php index 2ba7bdc011..3862cc2444 100644 --- a/tests/phpunit/includes/shell/CommandTest.php +++ b/tests/phpunit/includes/shell/CommandTest.php @@ -7,7 +7,7 @@ use Wikimedia\TestingAccessWrapper; * @covers \MediaWiki\Shell\Command * @group Shell */ -class CommandTest extends PHPUnit_Framework_TestCase { +class CommandTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/shell/FirejailCommandTest.php b/tests/phpunit/includes/shell/FirejailCommandTest.php index 15853753c1..199393c692 100644 --- a/tests/phpunit/includes/shell/FirejailCommandTest.php +++ b/tests/phpunit/includes/shell/FirejailCommandTest.php @@ -23,7 +23,7 @@ use MediaWiki\Shell\FirejailCommand; use MediaWiki\Shell\Shell; use Wikimedia\TestingAccessWrapper; -class FirejailCommandTest extends PHPUnit_Framework_TestCase { +class FirejailCommandTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/shell/ShellTest.php b/tests/phpunit/includes/shell/ShellTest.php index 986a66560e..8162bc0299 100644 --- a/tests/phpunit/includes/shell/ShellTest.php +++ b/tests/phpunit/includes/shell/ShellTest.php @@ -6,7 +6,7 @@ use MediaWiki\Shell\Shell; * @covers \MediaWiki\Shell\Shell * @group Shell */ -class ShellTest extends PHPUnit_Framework_TestCase { +class ShellTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/site/FileBasedSiteLookupTest.php b/tests/phpunit/includes/site/FileBasedSiteLookupTest.php index 05aa6d393a..69e0e38936 100644 --- a/tests/phpunit/includes/site/FileBasedSiteLookupTest.php +++ b/tests/phpunit/includes/site/FileBasedSiteLookupTest.php @@ -27,7 +27,7 @@ * * @author Katie Filbert < aude.wiki@gmail.com > */ -class FileBasedSiteLookupTest extends PHPUnit_Framework_TestCase { +class FileBasedSiteLookupTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/site/MediaWikiPageNameNormalizerTest.php b/tests/phpunit/includes/site/MediaWikiPageNameNormalizerTest.php index d2305508e5..2ac2714650 100644 --- a/tests/phpunit/includes/site/MediaWikiPageNameNormalizerTest.php +++ b/tests/phpunit/includes/site/MediaWikiPageNameNormalizerTest.php @@ -27,7 +27,7 @@ use MediaWiki\Site\MediaWikiPageNameNormalizer; * * @author Marius Hoch */ -class MediaWikiPageNameNormalizerTest extends PHPUnit_Framework_TestCase { +class MediaWikiPageNameNormalizerTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/site/SiteExporterTest.php b/tests/phpunit/includes/site/SiteExporterTest.php index 3a41b5fc69..279bbb21c5 100644 --- a/tests/phpunit/includes/site/SiteExporterTest.php +++ b/tests/phpunit/includes/site/SiteExporterTest.php @@ -29,7 +29,7 @@ * * @author Daniel Kinzler */ -class SiteExporterTest extends PHPUnit_Framework_TestCase { +class SiteExporterTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/site/SiteImporterTest.php b/tests/phpunit/includes/site/SiteImporterTest.php index 373dcc2912..7c949ac7d0 100644 --- a/tests/phpunit/includes/site/SiteImporterTest.php +++ b/tests/phpunit/includes/site/SiteImporterTest.php @@ -29,7 +29,7 @@ * * @author Daniel Kinzler */ -class SiteImporterTest extends PHPUnit_Framework_TestCase { +class SiteImporterTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/site/SitesCacheFileBuilderTest.php b/tests/phpunit/includes/site/SitesCacheFileBuilderTest.php index c411ed8799..8c84ce57c0 100644 --- a/tests/phpunit/includes/site/SitesCacheFileBuilderTest.php +++ b/tests/phpunit/includes/site/SitesCacheFileBuilderTest.php @@ -27,7 +27,7 @@ * * @author Katie Filbert < aude.wiki@gmail.com > */ -class SitesCacheFileBuilderTest extends PHPUnit_Framework_TestCase { +class SitesCacheFileBuilderTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/sparql/SparqlClientTest.php b/tests/phpunit/includes/sparql/SparqlClientTest.php index e07e425930..cfaf49b5cd 100644 --- a/tests/phpunit/includes/sparql/SparqlClientTest.php +++ b/tests/phpunit/includes/sparql/SparqlClientTest.php @@ -4,12 +4,11 @@ namespace MediaWiki\Sparql; use Http; use MediaWiki\Http\HttpRequestFactory; use MWHttpRequest; -use PHPUnit_Framework_TestCase; /** * @covers \MediaWiki\Sparql\SparqlClient */ -class SparqlClientTest extends PHPUnit_Framework_TestCase { +class SparqlClientTest extends \PHPUnit\Framework\TestCase { private function getRequestFactory( $request ) { $requestFactory = $this->getMock( HttpRequestFactory::class ); diff --git a/tests/phpunit/includes/utils/AvroValidatorTest.php b/tests/phpunit/includes/utils/AvroValidatorTest.php index caeeaabeae..12d2574e69 100644 --- a/tests/phpunit/includes/utils/AvroValidatorTest.php +++ b/tests/phpunit/includes/utils/AvroValidatorTest.php @@ -12,7 +12,7 @@ /** * @covers AvroValidator */ -class AvroValidatorTest extends PHPUnit_Framework_TestCase { +class AvroValidatorTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/utils/ClassCollectorTest.php b/tests/phpunit/includes/utils/ClassCollectorTest.php index 796d459a67..9e5163f9ce 100644 --- a/tests/phpunit/includes/utils/ClassCollectorTest.php +++ b/tests/phpunit/includes/utils/ClassCollectorTest.php @@ -3,7 +3,7 @@ /** * @covers ClassCollector */ -class ClassCollectorTest extends PHPUnit_Framework_TestCase { +class ClassCollectorTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/utils/FileContentsHasherTest.php b/tests/phpunit/includes/utils/FileContentsHasherTest.php index b3885bdd25..316d9f429a 100644 --- a/tests/phpunit/includes/utils/FileContentsHasherTest.php +++ b/tests/phpunit/includes/utils/FileContentsHasherTest.php @@ -3,7 +3,7 @@ /** * @covers FileContentsHasherTest */ -class FileContentsHasherTest extends PHPUnit_Framework_TestCase { +class FileContentsHasherTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/utils/MWCryptHashTest.php b/tests/phpunit/includes/utils/MWCryptHashTest.php index 66c8d00e3a..94705bff48 100644 --- a/tests/phpunit/includes/utils/MWCryptHashTest.php +++ b/tests/phpunit/includes/utils/MWCryptHashTest.php @@ -5,7 +5,7 @@ * * @covers MWCryptHash */ -class MWCryptHashTest extends PHPUnit_Framework_TestCase { +class MWCryptHashTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/includes/utils/MWRestrictionsTest.php b/tests/phpunit/includes/utils/MWRestrictionsTest.php index c411e53319..abdfbb1459 100644 --- a/tests/phpunit/includes/utils/MWRestrictionsTest.php +++ b/tests/phpunit/includes/utils/MWRestrictionsTest.php @@ -1,5 +1,5 @@ will( $this->returnCallback( function ( $a, $conj ) { $sqlConj = $conj === LIST_AND ? ' AND ' : ' OR '; - return join( $sqlConj, array_map( function ( $s ) { + return implode( $sqlConj, array_map( function ( $s ) { return '(' . $s . ')'; }, $a ) ); @@ -1572,7 +1572,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiTestCase { ) ->will( $this->returnCallback( function ( $a, $conj ) { $sqlConj = $conj === LIST_AND ? ' AND ' : ' OR '; - return join( $sqlConj, array_map( function ( $s ) { + return implode( $sqlConj, array_map( function ( $s ) { return '(' . $s . ')'; }, $a ) ); diff --git a/tests/phpunit/includes/watcheditem/WatchedItemStoreUnitTest.php b/tests/phpunit/includes/watcheditem/WatchedItemStoreUnitTest.php index 52e653cb4c..948517067c 100644 --- a/tests/phpunit/includes/watcheditem/WatchedItemStoreUnitTest.php +++ b/tests/phpunit/includes/watcheditem/WatchedItemStoreUnitTest.php @@ -443,7 +443,7 @@ class WatchedItemStoreUnitTest extends MediaWikiTestCase { ) ->will( $this->returnCallback( function ( $a, $conj ) { $sqlConj = $conj === LIST_AND ? ' AND ' : ' OR '; - return join( $sqlConj, array_map( function ( $s ) { + return implode( $sqlConj, array_map( function ( $s ) { return '(' . $s . ')'; }, $a ) ); @@ -540,7 +540,7 @@ class WatchedItemStoreUnitTest extends MediaWikiTestCase { ) ->will( $this->returnCallback( function ( $a, $conj ) { $sqlConj = $conj === LIST_AND ? ' AND ' : ' OR '; - return join( $sqlConj, array_map( function ( $s ) { + return implode( $sqlConj, array_map( function ( $s ) { return '(' . $s . ')'; }, $a ) ); diff --git a/tests/phpunit/languages/LanguageCodeTest.php b/tests/phpunit/languages/LanguageCodeTest.php index d77291a042..544a063566 100644 --- a/tests/phpunit/languages/LanguageCodeTest.php +++ b/tests/phpunit/languages/LanguageCodeTest.php @@ -6,7 +6,7 @@ * * @author Thiemo Kreuz */ -class LanguageCodeTest extends PHPUnit_Framework_TestCase { +class LanguageCodeTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/maintenance/BenchmarkerTest.php b/tests/phpunit/maintenance/BenchmarkerTest.php index 0b8d0d98e4..c15d789d0e 100644 --- a/tests/phpunit/maintenance/BenchmarkerTest.php +++ b/tests/phpunit/maintenance/BenchmarkerTest.php @@ -4,13 +4,12 @@ namespace MediaWiki\Tests\Maintenance; use Benchmarker; use MediaWikiCoversValidator; -use PHPUnit_Framework_TestCase; use Wikimedia\TestingAccessWrapper; /** * @covers Benchmarker */ -class BenchmarkerTest extends PHPUnit_Framework_TestCase { +class BenchmarkerTest extends \PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/maintenance/fetchTextTest.php b/tests/phpunit/maintenance/fetchTextTest.php index 14dfb4448b..97e0c88fd8 100644 --- a/tests/phpunit/maintenance/fetchTextTest.php +++ b/tests/phpunit/maintenance/fetchTextTest.php @@ -215,7 +215,7 @@ class FetchTextTest extends MediaWikiTestCase { function testExistingSeveral() { $this->assertFilter( - join( "\n", [ + implode( "\n", [ self::$textId1, self::$textId5, self::$textId3, diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index a78bd82ce7..fa249b2244 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -113,7 +113,7 @@ class PHPUnitMaintClass extends Maintenance { } } - if ( !class_exists( 'PHPUnit_Framework_TestCase' ) ) { + if ( !class_exists( 'PHPUnit\\Framework\\TestCase' ) ) { echo "PHPUnit not found. Please install it and other dev dependencies by running `composer install` in MediaWiki root directory.\n"; exit( 1 ); diff --git a/tests/phpunit/structure/AvailableRightsTest.php b/tests/phpunit/structure/AvailableRightsTest.php index 4ab0c2c9af..6c2ff024e1 100644 --- a/tests/phpunit/structure/AvailableRightsTest.php +++ b/tests/phpunit/structure/AvailableRightsTest.php @@ -6,7 +6,7 @@ * * @author Marius Hoch < hoo@online.de > */ -class AvailableRightsTest extends PHPUnit_Framework_TestCase { +class AvailableRightsTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/structure/ExtensionJsonValidationTest.php b/tests/phpunit/structure/ExtensionJsonValidationTest.php index 0cf4659471..60c97ccfac 100644 --- a/tests/phpunit/structure/ExtensionJsonValidationTest.php +++ b/tests/phpunit/structure/ExtensionJsonValidationTest.php @@ -20,7 +20,7 @@ * Validates all loaded extensions and skins using the ExtensionRegistry * against the extension.json schema in the docs/ folder. */ -class ExtensionJsonValidationTest extends PHPUnit_Framework_TestCase { +class ExtensionJsonValidationTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; diff --git a/tests/phpunit/structure/StructureTest.php b/tests/phpunit/structure/StructureTest.php index 9016cb7b67..35434634cf 100644 --- a/tests/phpunit/structure/StructureTest.php +++ b/tests/phpunit/structure/StructureTest.php @@ -25,6 +25,7 @@ class StructureTest extends MediaWikiTestCase { 'MediaWikiTestCase', 'ResourceLoaderTestCase', 'PHPUnit_Framework_TestCase', + '\\?PHPUnit\\Framework\\TestCase', 'DumpTestCase', ] ); $testClassRegex = "^class .* extends ($testClassRegex)"; -- 2.20.1