diff --git a/.phpcs.xml b/.phpcs.xml index 9732f1016af..6e302dc2a4d 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -17,7 +17,6 @@ - diff --git a/tests/integration/includes/http/MWHttpRequestTestCase.php b/tests/integration/includes/http/MWHttpRequestTestCase.php index d17b9b31e6e..f185e5def99 100644 --- a/tests/integration/includes/http/MWHttpRequestTestCase.php +++ b/tests/integration/includes/http/MWHttpRequestTestCase.php @@ -11,7 +11,7 @@ abstract class MWHttpRequestTestCase extends PHPUnit\Framework\TestCase { /** @var HttpRequestFactory */ private $factory; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->oldHttpEngine = Http::$httpEngine; Http::$httpEngine = static::$httpEngine; @@ -31,7 +31,7 @@ abstract class MWHttpRequestTestCase extends PHPUnit\Framework\TestCase { } } - public function tearDown() { + public function tearDown() : void { parent::tearDown(); Http::$httpEngine = $this->oldHttpEngine; } diff --git a/tests/integration/includes/shell/FirejailCommandIntegrationTest.php b/tests/integration/includes/shell/FirejailCommandIntegrationTest.php index 3c7cb143823..faaf7c50dea 100644 --- a/tests/integration/includes/shell/FirejailCommandIntegrationTest.php +++ b/tests/integration/includes/shell/FirejailCommandIntegrationTest.php @@ -14,7 +14,7 @@ use MediaWiki\Shell\Shell; */ class FirejailCommandIntegrationTest extends PHPUnit\Framework\TestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); if ( Shell::isDisabled() ) { $this->markTestSkipped( 'shelling out is disabled' ); diff --git a/tests/phpunit/MediaWikiIntegrationTestCase.php b/tests/phpunit/MediaWikiIntegrationTestCase.php index 69b3a243a90..b4d6318c8f5 100644 --- a/tests/phpunit/MediaWikiIntegrationTestCase.php +++ b/tests/phpunit/MediaWikiIntegrationTestCase.php @@ -709,7 +709,7 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase { * * @par Example * @code - * protected function setUp() { + * protected function setUp() : void { * $this->setMwGlobals( 'wgRestrictStuff', true ); * } * diff --git a/tests/phpunit/MediaWikiLangTestCase.php b/tests/phpunit/MediaWikiLangTestCase.php index 4b0edb13f18..80641e52834 100644 --- a/tests/phpunit/MediaWikiLangTestCase.php +++ b/tests/phpunit/MediaWikiLangTestCase.php @@ -6,7 +6,7 @@ use MediaWiki\MediaWikiServices; * Base class that store and restore the Language objects */ abstract class MediaWikiLangTestCase extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { global $wgLanguageCode; $contLang = MediaWikiServices::getInstance()->getContentLanguage(); diff --git a/tests/phpunit/MediaWikiUnitTestCase.php b/tests/phpunit/MediaWikiUnitTestCase.php index de7957ced92..855988b0ce3 100644 --- a/tests/phpunit/MediaWikiUnitTestCase.php +++ b/tests/phpunit/MediaWikiUnitTestCase.php @@ -117,7 +117,7 @@ abstract class MediaWikiUnitTestCase extends TestCase { ] ) ); } - protected function tearDown() { + protected function tearDown() : void { // Quick reset between tests foreach ( $GLOBALS as $key => $_ ) { if ( $key !== 'GLOBALS' && !array_key_exists( $key, self::$unitGlobals ) ) { diff --git a/tests/phpunit/ResourceLoaderTestCase.php b/tests/phpunit/ResourceLoaderTestCase.php index 6b4b4d4220f..63b2e233453 100644 --- a/tests/phpunit/ResourceLoaderTestCase.php +++ b/tests/phpunit/ResourceLoaderTestCase.php @@ -76,7 +76,7 @@ abstract class ResourceLoaderTestCase extends MediaWikiTestCase { return new HashConfig( self::getSettings() ); } - protected function setUp() { + protected function setUp() : void { parent::setUp(); ResourceLoader::clearCache(); diff --git a/tests/phpunit/includes/ActorMigrationTest.php b/tests/phpunit/includes/ActorMigrationTest.php index 3a256e4437e..5dade34f792 100644 --- a/tests/phpunit/includes/ActorMigrationTest.php +++ b/tests/phpunit/includes/ActorMigrationTest.php @@ -17,7 +17,7 @@ class ActorMigrationTest extends MediaWikiLangTestCase { 'actor', ]; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $w = TestingAccessWrapper::newFromClass( ActorMigration::class ); @@ -48,7 +48,7 @@ class ActorMigrationTest extends MediaWikiLangTestCase { ]; } - protected function tearDown() { + protected function tearDown() : void { parent::tearDown(); ScopedCallback::consume( $this->resetActorMigration ); } diff --git a/tests/phpunit/includes/AutoLoaderTest.php b/tests/phpunit/includes/AutoLoaderTest.php index af6911d6001..848030ac410 100644 --- a/tests/phpunit/includes/AutoLoaderTest.php +++ b/tests/phpunit/includes/AutoLoaderTest.php @@ -7,7 +7,7 @@ class AutoLoaderTest extends MediaWikiTestCase { private $oldPsr4; - protected function setUp() { + protected function setUp() : void { parent::setUp(); // Fancy dance to trigger a rebuild of AutoLoader::$autoloadLocalClassesLower @@ -30,7 +30,7 @@ class AutoLoaderTest extends MediaWikiTestCase { __DIR__ . '/../data/autoloader/psr4'; } - protected function tearDown() { + protected function tearDown() : void { AutoLoader::$psr4Namespaces = $this->oldPsr4; parent::tearDown(); } diff --git a/tests/phpunit/includes/CategoryTest.php b/tests/phpunit/includes/CategoryTest.php index 60fb144a44f..ddacf0dc1d7 100644 --- a/tests/phpunit/includes/CategoryTest.php +++ b/tests/phpunit/includes/CategoryTest.php @@ -5,7 +5,7 @@ * @group Category */ class CategoryTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/ContentSecurityPolicyTest.php b/tests/phpunit/includes/ContentSecurityPolicyTest.php index cd081f0d6e0..835682e1e39 100644 --- a/tests/phpunit/includes/ContentSecurityPolicyTest.php +++ b/tests/phpunit/includes/ContentSecurityPolicyTest.php @@ -6,7 +6,7 @@ class ContentSecurityPolicyTest extends MediaWikiTestCase { /** @var ContentSecurityPolicy */ private $csp; - protected function setUp() { + protected function setUp() : void { global $wgUploadDirectory; $this->setMwGlobals( [ 'wgAllowExternalImages' => false, @@ -49,7 +49,7 @@ class ContentSecurityPolicyTest extends MediaWikiTestCase { $this->csp = TestingAccessWrapper::newFromObject( $csp ); $this->csp->nonce = 'secret'; - return parent::setUp(); + parent::setUp(); } /** diff --git a/tests/phpunit/includes/DeprecatedGlobalTest.php b/tests/phpunit/includes/DeprecatedGlobalTest.php index 59016d71636..47978a6db18 100644 --- a/tests/phpunit/includes/DeprecatedGlobalTest.php +++ b/tests/phpunit/includes/DeprecatedGlobalTest.php @@ -26,12 +26,12 @@ use PHPUnit\Framework\Error\Deprecated; class DeprecatedGlobalTest extends MediaWikiTestCase { private $oldErrorLevel; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->oldErrorLevel = error_reporting( -1 ); } - public function tearDown() { + public function tearDown() : void { error_reporting( $this->oldErrorLevel ); parent::tearDown(); } diff --git a/tests/phpunit/includes/DiffHistoryBlobTest.php b/tests/phpunit/includes/DiffHistoryBlobTest.php index b75862ea0c9..8e8eb54f40d 100644 --- a/tests/phpunit/includes/DiffHistoryBlobTest.php +++ b/tests/phpunit/includes/DiffHistoryBlobTest.php @@ -2,7 +2,7 @@ class DiffHistoryBlobTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->checkPHPExtension( 'hash' ); diff --git a/tests/phpunit/includes/EditPageTest.php b/tests/phpunit/includes/EditPageTest.php index 22cc3f15e29..4d9e0626573 100644 --- a/tests/phpunit/includes/EditPageTest.php +++ b/tests/phpunit/includes/EditPageTest.php @@ -13,7 +13,7 @@ use MediaWiki\MediaWikiServices; */ class EditPageTest extends MediaWikiLangTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $contLang = MediaWikiServices::getInstance()->getContentLanguage(); diff --git a/tests/phpunit/includes/ExportTest.php b/tests/phpunit/includes/ExportTest.php index af10b9c4a62..da0b82e040c 100644 --- a/tests/phpunit/includes/ExportTest.php +++ b/tests/phpunit/includes/ExportTest.php @@ -11,7 +11,7 @@ use MediaWiki\MediaWikiServices; */ class ExportTest extends MediaWikiLangTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ 'wgCapitalLinks' => true, diff --git a/tests/phpunit/includes/ExtraParserTest.php b/tests/phpunit/includes/ExtraParserTest.php index 51bea6339b4..ccd2a6af5b3 100644 --- a/tests/phpunit/includes/ExtraParserTest.php +++ b/tests/phpunit/includes/ExtraParserTest.php @@ -15,7 +15,7 @@ class ExtraParserTest extends MediaWikiTestCase { /** @var Parser */ protected $parser; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/FauxRequestTest.php b/tests/phpunit/includes/FauxRequestTest.php index fc98113e7aa..dba07a57f2e 100644 --- a/tests/phpunit/includes/FauxRequestTest.php +++ b/tests/phpunit/includes/FauxRequestTest.php @@ -6,12 +6,12 @@ class FauxRequestTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->orgWgServer = $GLOBALS['wgServer']; } - public function tearDown() { + public function tearDown() : void { $GLOBALS['wgServer'] = $this->orgWgServer; parent::tearDown(); } diff --git a/tests/phpunit/includes/GitInfoTest.php b/tests/phpunit/includes/GitInfoTest.php index 67e480c4802..a2ca5230fdc 100644 --- a/tests/phpunit/includes/GitInfoTest.php +++ b/tests/phpunit/includes/GitInfoTest.php @@ -37,7 +37,7 @@ class GitInfoTest extends MediaWikiTestCase { } } - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( 'wgGitInfoCacheDirectory', __DIR__ . '/../data/gitinfo' ); } diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php index 7b050ec36d3..b7255dc6f33 100644 --- a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php +++ b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php @@ -7,7 +7,7 @@ use MediaWiki\Logger\LegacyLogger; * @group GlobalFunctions */ class GlobalTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $readOnlyFile = $this->getNewTempFile(); diff --git a/tests/phpunit/includes/GlobalFunctions/wfParseUrlTest.php b/tests/phpunit/includes/GlobalFunctions/wfParseUrlTest.php index b20cfb5c22b..4cb8108bfa1 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfParseUrlTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfParseUrlTest.php @@ -25,7 +25,7 @@ * @covers ::wfParseUrl */ class WfParseUrlTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( 'wgUrlProtocols', [ diff --git a/tests/phpunit/includes/GlobalFunctions/wfThumbIsStandardTest.php b/tests/phpunit/includes/GlobalFunctions/wfThumbIsStandardTest.php index bdba6a355e2..ceb58a4bda3 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfThumbIsStandardTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfThumbIsStandardTest.php @@ -8,7 +8,7 @@ use MediaWiki\MediaWikiServices; */ class WfThumbIsStandardTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/HooksTest.php b/tests/phpunit/includes/HooksTest.php index bfff1ddce75..b44ed908675 100644 --- a/tests/phpunit/includes/HooksTest.php +++ b/tests/phpunit/includes/HooksTest.php @@ -4,7 +4,7 @@ use PHPUnit\Framework\Error\Deprecated; class HooksTest extends MediaWikiTestCase { - public function setUp() { + public function setUp() : void { global $wgHooks; parent::setUp(); Hooks::clear( 'MediaWikiHooksTest001' ); diff --git a/tests/phpunit/includes/HtmlTest.php b/tests/phpunit/includes/HtmlTest.php index 935bf0ccf85..96ec0620519 100644 --- a/tests/phpunit/includes/HtmlTest.php +++ b/tests/phpunit/includes/HtmlTest.php @@ -6,7 +6,7 @@ use PHPUnit\Framework\Error\Notice; class HtmlTest extends MediaWikiTestCase { private $restoreWarnings; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ @@ -69,7 +69,7 @@ class HtmlTest extends MediaWikiTestCase { $this->restoreWarnings = false; } - protected function tearDown() { + protected function tearDown() : void { if ( $this->restoreWarnings ) { $this->restoreWarnings = false; Wikimedia\restoreWarnings(); diff --git a/tests/phpunit/includes/LinkFilterTest.php b/tests/phpunit/includes/LinkFilterTest.php index 28ddc09bdd1..d1033e4df2e 100644 --- a/tests/phpunit/includes/LinkFilterTest.php +++ b/tests/phpunit/includes/LinkFilterTest.php @@ -8,7 +8,7 @@ use Wikimedia\Rdbms\LikeMatch; */ class LinkFilterTest extends MediaWikiLangTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( 'wgUrlProtocols', [ diff --git a/tests/phpunit/includes/MWTimestampTest.php b/tests/phpunit/includes/MWTimestampTest.php index 9735eebd4ba..fa78b3ea375 100644 --- a/tests/phpunit/includes/MWTimestampTest.php +++ b/tests/phpunit/includes/MWTimestampTest.php @@ -4,7 +4,7 @@ * Tests timestamp parsing and output. */ class MWTimestampTest extends MediaWikiLangTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); // Avoid 'GetHumanTimestamp' hook and others diff --git a/tests/phpunit/includes/MediaWikiTest.php b/tests/phpunit/includes/MediaWikiTest.php index 77bbc07b341..ba6f512a0b6 100644 --- a/tests/phpunit/includes/MediaWikiTest.php +++ b/tests/phpunit/includes/MediaWikiTest.php @@ -3,7 +3,7 @@ class MediaWikiTest extends MediaWikiTestCase { private $oldServer, $oldGet, $oldPost; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ @@ -20,7 +20,7 @@ class MediaWikiTest extends MediaWikiTestCase { $this->oldPost = $_POST; } - protected function tearDown() { + protected function tearDown() : void { parent::tearDown(); $_SERVER = $this->oldServer; $_GET = $this->oldGet; diff --git a/tests/phpunit/includes/MessageTest.php b/tests/phpunit/includes/MessageTest.php index c9d64845b75..4f5456e6376 100644 --- a/tests/phpunit/includes/MessageTest.php +++ b/tests/phpunit/includes/MessageTest.php @@ -8,7 +8,7 @@ use Wikimedia\TestingAccessWrapper; */ class MessageTest extends MediaWikiLangTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/MovePageTest.php b/tests/phpunit/includes/MovePageTest.php index 9c054f0366e..ffb15a88df6 100644 --- a/tests/phpunit/includes/MovePageTest.php +++ b/tests/phpunit/includes/MovePageTest.php @@ -95,7 +95,7 @@ class MovePageTest extends MediaWikiTestCase { ); } - public function setUp() { + public function setUp() : void { parent::setUp(); // Ensure we have some pages that are guaranteed to exist or not diff --git a/tests/phpunit/includes/MultiHttpClientTest.php b/tests/phpunit/includes/MultiHttpClientTest.php index 1c7e62d092b..0c619f69985 100644 --- a/tests/phpunit/includes/MultiHttpClientTest.php +++ b/tests/phpunit/includes/MultiHttpClientTest.php @@ -8,7 +8,7 @@ class MultiHttpClientTest extends MediaWikiTestCase { protected $client; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $client = $this->getMockBuilder( MultiHttpClient::class ) ->setConstructorArgs( [ [] ] ) diff --git a/tests/phpunit/includes/OutputPageTest.php b/tests/phpunit/includes/OutputPageTest.php index 394d0b263c6..181bc9b5cf7 100644 --- a/tests/phpunit/includes/OutputPageTest.php +++ b/tests/phpunit/includes/OutputPageTest.php @@ -22,12 +22,12 @@ class OutputPageTest extends MediaWikiTestCase { // @codingStandardsIgnoreEnd // Ensure that we don't affect the global ResourceLoader state. - protected function setUp() { + protected function setUp() : void { parent::setUp(); ResourceLoader::clearCache(); } - protected function tearDown() { + protected function tearDown() : void { parent::tearDown(); ResourceLoader::clearCache(); } diff --git a/tests/phpunit/includes/PagePropsTest.php b/tests/phpunit/includes/PagePropsTest.php index 222b3e3a024..5faae557056 100644 --- a/tests/phpunit/includes/PagePropsTest.php +++ b/tests/phpunit/includes/PagePropsTest.php @@ -28,7 +28,7 @@ class PagePropsTest extends MediaWikiLangTestCase { */ private $the_properties; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/Permissions/PermissionManagerTest.php b/tests/phpunit/includes/Permissions/PermissionManagerTest.php index 258881fc24f..b5c3fbfabb9 100644 --- a/tests/phpunit/includes/Permissions/PermissionManagerTest.php +++ b/tests/phpunit/includes/Permissions/PermissionManagerTest.php @@ -53,7 +53,7 @@ class PermissionManagerTest extends MediaWikiLangTestCase { /** Constant for self::testIsBlockedFrom */ const USER_TALK_PAGE = ''; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $localZone = 'UTC'; @@ -124,7 +124,7 @@ class PermissionManagerTest extends MediaWikiLangTestCase { } } - public function tearDown() { + public function tearDown() : void { parent::tearDown(); $this->restoreMwServices(); } diff --git a/tests/phpunit/includes/PrefixSearchTest.php b/tests/phpunit/includes/PrefixSearchTest.php index 4d9f8e171f1..4e799d9d787 100644 --- a/tests/phpunit/includes/PrefixSearchTest.php +++ b/tests/phpunit/includes/PrefixSearchTest.php @@ -43,7 +43,7 @@ class PrefixSearchTest extends MediaWikiLangTestCase { $this->insertPage( Title::makeTitle( self::NS_NONCAP, 'sandbox' ) ); } - protected function setUp() { + protected function setUp() : void { parent::setUp(); if ( !$this->isWikitextNS( NS_MAIN ) ) { @@ -62,7 +62,7 @@ class PrefixSearchTest extends MediaWikiLangTestCase { TestingAccessWrapper::newFromClass( Hooks::class )->handlers = []; } - public function tearDown() { + public function tearDown() : void { parent::tearDown(); TestingAccessWrapper::newFromClass( Hooks::class )->handlers = $this->originalHandlers; diff --git a/tests/phpunit/includes/Revision/MutableRevisionRecordTest.php b/tests/phpunit/includes/Revision/MutableRevisionRecordTest.php index f0d25a6d796..f7b609c883c 100644 --- a/tests/phpunit/includes/Revision/MutableRevisionRecordTest.php +++ b/tests/phpunit/includes/Revision/MutableRevisionRecordTest.php @@ -25,7 +25,7 @@ class MutableRevisionRecordTest extends MediaWikiTestCase { use RevisionRecordTests; - public function setUp() { + public function setUp() : void { Title::clearCaches(); parent::setUp(); } diff --git a/tests/phpunit/includes/Revision/RenderedRevisionTest.php b/tests/phpunit/includes/Revision/RenderedRevisionTest.php index c61892356c1..0998c14fdab 100644 --- a/tests/phpunit/includes/Revision/RenderedRevisionTest.php +++ b/tests/phpunit/includes/Revision/RenderedRevisionTest.php @@ -31,7 +31,7 @@ class RenderedRevisionTest extends MediaWikiTestCase { /** @var callable */ private $combinerCallback; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->combinerCallback = function ( RenderedRevision $rr, array $hints = [] ) { diff --git a/tests/phpunit/includes/Revision/RevisionStoreDbTestBase.php b/tests/phpunit/includes/Revision/RevisionStoreDbTestBase.php index eea532100c0..c10daa875c8 100644 --- a/tests/phpunit/includes/Revision/RevisionStoreDbTestBase.php +++ b/tests/phpunit/includes/Revision/RevisionStoreDbTestBase.php @@ -71,7 +71,7 @@ abstract class RevisionStoreDbTestBase extends MediaWikiTestCase { */ abstract protected function getMcrTablesToReset(); - public function setUp() { + public function setUp() : void { parent::setUp(); $this->tablesUsed[] = 'archive'; $this->tablesUsed[] = 'page'; diff --git a/tests/phpunit/includes/RevisionDbTestBase.php b/tests/phpunit/includes/RevisionDbTestBase.php index 436d225d897..bcde8a3e9d6 100644 --- a/tests/phpunit/includes/RevisionDbTestBase.php +++ b/tests/phpunit/includes/RevisionDbTestBase.php @@ -61,7 +61,7 @@ abstract class RevisionDbTestBase extends MediaWikiTestCase { */ abstract protected function getMcrTablesToReset(); - protected function setUp() { + protected function setUp() : void { $this->tablesUsed += $this->getMcrTablesToReset(); parent::setUp(); diff --git a/tests/phpunit/includes/RevisionMcrDbTest.php b/tests/phpunit/includes/RevisionMcrDbTest.php index 2da2275202a..82162de9d92 100644 --- a/tests/phpunit/includes/RevisionMcrDbTest.php +++ b/tests/phpunit/includes/RevisionMcrDbTest.php @@ -19,7 +19,7 @@ class RevisionMcrDbTest extends RevisionDbTestBase { use McrSchemaOverride; - public function setUp() { + public function setUp() : void { parent::setUp(); } diff --git a/tests/phpunit/includes/RevisionTest.php b/tests/phpunit/includes/RevisionTest.php index baa64b0cf67..1ee2e67773a 100644 --- a/tests/phpunit/includes/RevisionTest.php +++ b/tests/phpunit/includes/RevisionTest.php @@ -17,7 +17,7 @@ use Wikimedia\Rdbms\LoadBalancer; */ class RevisionTest extends MediaWikiTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); $this->setMwGlobals( 'wgMultiContentRevisionSchemaMigrationStage', diff --git a/tests/phpunit/includes/SampleTest.php b/tests/phpunit/includes/SampleTest.php index a965a60394d..bf8a067739e 100644 --- a/tests/phpunit/includes/SampleTest.php +++ b/tests/phpunit/includes/SampleTest.php @@ -8,7 +8,7 @@ class SampleTest extends MediaWikiLangTestCase { /** * Anything that needs to happen before your tests should go here. */ - protected function setUp() { + protected function setUp() : void { // Be sure to call the parent setup and teardown functions. // This makes sure that all the various cleanup and restorations // happen as they should (including the restoration for setMwGlobals). @@ -25,7 +25,7 @@ class SampleTest extends MediaWikiLangTestCase { /** * Anything cleanup you need to do should go here. */ - protected function tearDown() { + protected function tearDown() : void { parent::tearDown(); } diff --git a/tests/phpunit/includes/Storage/DerivedPageDataUpdaterTest.php b/tests/phpunit/includes/Storage/DerivedPageDataUpdaterTest.php index c64169fd8c2..4ee1bdfa3b5 100644 --- a/tests/phpunit/includes/Storage/DerivedPageDataUpdaterTest.php +++ b/tests/phpunit/includes/Storage/DerivedPageDataUpdaterTest.php @@ -33,7 +33,7 @@ use DeferredUpdates; */ class DerivedPageDataUpdaterTest extends MediaWikiTestCase { - public function tearDown() { + public function tearDown() : void { MWTimestamp::setFakeTime( false ); parent::tearDown(); diff --git a/tests/phpunit/includes/Storage/NameTableStoreTest.php b/tests/phpunit/includes/Storage/NameTableStoreTest.php index 0c22cb29e2b..665122fc9c4 100644 --- a/tests/phpunit/includes/Storage/NameTableStoreTest.php +++ b/tests/phpunit/includes/Storage/NameTableStoreTest.php @@ -25,7 +25,7 @@ use Wikimedia\TestingAccessWrapper; */ class NameTableStoreTest extends MediaWikiTestCase { - public function setUp() { + public function setUp() : void { $this->tablesUsed[] = 'slot_roles'; parent::setUp(); } diff --git a/tests/phpunit/includes/Storage/PageUpdaterTest.php b/tests/phpunit/includes/Storage/PageUpdaterTest.php index 9d606059178..592d5e8cadd 100644 --- a/tests/phpunit/includes/Storage/PageUpdaterTest.php +++ b/tests/phpunit/includes/Storage/PageUpdaterTest.php @@ -22,7 +22,7 @@ use WikiPage; */ class PageUpdaterTest extends MediaWikiTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); MediaWikiServices::getInstance()->getSlotRoleRegistry()->defineRoleWithModel( diff --git a/tests/phpunit/includes/TemplateParserTest.php b/tests/phpunit/includes/TemplateParserTest.php index 0bc44592fcd..ad2deb5f8f8 100644 --- a/tests/phpunit/includes/TemplateParserTest.php +++ b/tests/phpunit/includes/TemplateParserTest.php @@ -8,7 +8,7 @@ class TemplateParserTest extends MediaWikiTestCase { protected $templateDir; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/TimeAdjustTest.php b/tests/phpunit/includes/TimeAdjustTest.php index b59282dd798..3244e8946f0 100644 --- a/tests/phpunit/includes/TimeAdjustTest.php +++ b/tests/phpunit/includes/TimeAdjustTest.php @@ -3,7 +3,7 @@ use MediaWiki\MediaWikiServices; class TimeAdjustTest extends MediaWikiLangTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); } diff --git a/tests/phpunit/includes/TitleMethodsTest.php b/tests/phpunit/includes/TitleMethodsTest.php index c36f8525dbd..07fa2fb03b8 100644 --- a/tests/phpunit/includes/TitleMethodsTest.php +++ b/tests/phpunit/includes/TitleMethodsTest.php @@ -12,7 +12,7 @@ use MediaWiki\MediaWikiServices; */ class TitleMethodsTest extends MediaWikiLangTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->mergeMwGlobalArrayValue( @@ -462,7 +462,7 @@ class TitleMethodsTest extends MediaWikiLangTestCase { ); } - public function tearDown() { + public function tearDown() : void { Title::clearCaches(); parent::tearDown(); } diff --git a/tests/phpunit/includes/TitlePermissionTest.php b/tests/phpunit/includes/TitlePermissionTest.php index 79fc14461c4..51be0a33072 100644 --- a/tests/phpunit/includes/TitlePermissionTest.php +++ b/tests/phpunit/includes/TitlePermissionTest.php @@ -28,7 +28,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase { */ protected $user, $anonUser, $userUser, $altUser; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $localZone = 'UTC'; diff --git a/tests/phpunit/includes/TitleTest.php b/tests/phpunit/includes/TitleTest.php index 9d90a4ed87b..69226c9db6e 100644 --- a/tests/phpunit/includes/TitleTest.php +++ b/tests/phpunit/includes/TitleTest.php @@ -9,7 +9,7 @@ use MediaWiki\MediaWikiServices; * @group Title */ class TitleTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/WebRequestTest.php b/tests/phpunit/includes/WebRequestTest.php index 0199cdb7fd3..bd43706fd7a 100644 --- a/tests/phpunit/includes/WebRequestTest.php +++ b/tests/phpunit/includes/WebRequestTest.php @@ -5,7 +5,7 @@ */ class WebRequestTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->oldServer = $_SERVER; @@ -13,7 +13,7 @@ class WebRequestTest extends MediaWikiTestCase { $this->oldWgServer = $GLOBALS['wgServer']; } - protected function tearDown() { + protected function tearDown() : void { $_SERVER = $this->oldServer; $GLOBALS['wgRequest'] = $this->oldWgRequest; $GLOBALS['wgServer'] = $this->oldWgServer; diff --git a/tests/phpunit/includes/WikiMapTest.php b/tests/phpunit/includes/WikiMapTest.php index 6fe9218b7fc..c492fa8c9ba 100644 --- a/tests/phpunit/includes/WikiMapTest.php +++ b/tests/phpunit/includes/WikiMapTest.php @@ -9,7 +9,7 @@ use Wikimedia\Rdbms\DatabaseDomain; */ class WikiMapTest extends MediaWikiLangTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); $conf = new SiteConfiguration(); diff --git a/tests/phpunit/includes/XmlTest.php b/tests/phpunit/includes/XmlTest.php index 082650192b5..5b5af710870 100644 --- a/tests/phpunit/includes/XmlTest.php +++ b/tests/phpunit/includes/XmlTest.php @@ -7,7 +7,7 @@ use MediaWiki\MediaWikiServices; */ class XmlTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $langObj = MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( 'en' ); diff --git a/tests/phpunit/includes/actions/ActionTest.php b/tests/phpunit/includes/actions/ActionTest.php index 4d977cbf1ed..5b3a004a685 100644 --- a/tests/phpunit/includes/actions/ActionTest.php +++ b/tests/phpunit/includes/actions/ActionTest.php @@ -14,7 +14,7 @@ use MediaWiki\Block\Restriction\PageRestriction; */ class ActionTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $context = $this->getContext(); diff --git a/tests/phpunit/includes/actions/WatchActionTest.php b/tests/phpunit/includes/actions/WatchActionTest.php index 78ecaea5804..683f09c5582 100644 --- a/tests/phpunit/includes/actions/WatchActionTest.php +++ b/tests/phpunit/includes/actions/WatchActionTest.php @@ -19,7 +19,7 @@ class WatchActionTest extends MediaWikiTestCase { */ private $testWikiPage; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $testTitle = Title::newFromText( 'UTTest' ); @@ -32,7 +32,7 @@ class WatchActionTest extends MediaWikiTestCase { /** * @throws MWException */ - protected function tearDown() { + protected function tearDown() : void { parent::tearDown(); Hooks::clear( 'WatchArticle' ); diff --git a/tests/phpunit/includes/api/ApiBlockTest.php b/tests/phpunit/includes/api/ApiBlockTest.php index 3d9e758135b..6bde976e683 100644 --- a/tests/phpunit/includes/api/ApiBlockTest.php +++ b/tests/phpunit/includes/api/ApiBlockTest.php @@ -14,7 +14,7 @@ use MediaWiki\Block\Restriction\NamespaceRestriction; class ApiBlockTest extends ApiTestCase { protected $mUser = null; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->tablesUsed = array_merge( $this->tablesUsed, diff --git a/tests/phpunit/includes/api/ApiCSPReportTest.php b/tests/phpunit/includes/api/ApiCSPReportTest.php index b3e0543c789..ac6d52bb16d 100644 --- a/tests/phpunit/includes/api/ApiCSPReportTest.php +++ b/tests/phpunit/includes/api/ApiCSPReportTest.php @@ -7,7 +7,7 @@ */ class ApiCSPReportTest extends MediaWikiIntegrationTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); $this->setMwGlobals( [ 'CSPFalsePositiveUrls' => [], diff --git a/tests/phpunit/includes/api/ApiDeleteTest.php b/tests/phpunit/includes/api/ApiDeleteTest.php index 001b46d3f17..37d8c66dab2 100644 --- a/tests/phpunit/includes/api/ApiDeleteTest.php +++ b/tests/phpunit/includes/api/ApiDeleteTest.php @@ -13,7 +13,7 @@ */ class ApiDeleteTest extends ApiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->tablesUsed = array_merge( $this->tablesUsed, diff --git a/tests/phpunit/includes/api/ApiEditPageTest.php b/tests/phpunit/includes/api/ApiEditPageTest.php index c397e9e2715..01fd0829726 100644 --- a/tests/phpunit/includes/api/ApiEditPageTest.php +++ b/tests/phpunit/includes/api/ApiEditPageTest.php @@ -15,7 +15,7 @@ use MediaWiki\Block\DatabaseBlock; */ class ApiEditPageTest extends ApiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/api/ApiLoginTest.php b/tests/phpunit/includes/api/ApiLoginTest.php index 15486fedc3e..13e863c7e06 100644 --- a/tests/phpunit/includes/api/ApiLoginTest.php +++ b/tests/phpunit/includes/api/ApiLoginTest.php @@ -13,7 +13,7 @@ use Wikimedia\TestingAccessWrapper; * @covers ApiLogin */ class ApiLoginTest extends ApiTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); $this->tablesUsed[] = 'bot_passwords'; diff --git a/tests/phpunit/includes/api/ApiLogoutTest.php b/tests/phpunit/includes/api/ApiLogoutTest.php index 8254fdba7d9..9da4ab79fe9 100644 --- a/tests/phpunit/includes/api/ApiLogoutTest.php +++ b/tests/phpunit/includes/api/ApiLogoutTest.php @@ -9,7 +9,7 @@ */ class ApiLogoutTest extends ApiTestCase { - protected function setUp() { + protected function setUp() : void { global $wgRequest, $wgUser; parent::setUp(); diff --git a/tests/phpunit/includes/api/ApiOptionsTest.php b/tests/phpunit/includes/api/ApiOptionsTest.php index bafe09b5f12..7aa743f637e 100644 --- a/tests/phpunit/includes/api/ApiOptionsTest.php +++ b/tests/phpunit/includes/api/ApiOptionsTest.php @@ -21,7 +21,7 @@ class ApiOptionsTest extends MediaWikiLangTestCase { private static $Success = [ 'options' => 'success' ]; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->mUserMock = $this->getMockBuilder( User::class ) diff --git a/tests/phpunit/includes/api/ApiQueryLanguageinfoTest.php b/tests/phpunit/includes/api/ApiQueryLanguageinfoTest.php index 7d0609c8695..4e5f3b1f2e4 100644 --- a/tests/phpunit/includes/api/ApiQueryLanguageinfoTest.php +++ b/tests/phpunit/includes/api/ApiQueryLanguageinfoTest.php @@ -8,7 +8,7 @@ */ class ApiQueryLanguageinfoTest extends ApiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); // register custom language names so this test is independent of CLDR $this->setTemporaryHook( diff --git a/tests/phpunit/includes/api/ApiQueryPrefixSearchTest.php b/tests/phpunit/includes/api/ApiQueryPrefixSearchTest.php index cb5e76dd8da..9cbffbf48c6 100644 --- a/tests/phpunit/includes/api/ApiQueryPrefixSearchTest.php +++ b/tests/phpunit/includes/api/ApiQueryPrefixSearchTest.php @@ -10,7 +10,7 @@ class ApiQueryPrefixSearchTest extends ApiTestCase { const TEST_QUERY = 'unittest'; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->setMwGlobals( [ 'wgSearchType' => MockCompletionSearchEngine::class, diff --git a/tests/phpunit/includes/api/ApiQueryRecentChangesIntegrationTest.php b/tests/phpunit/includes/api/ApiQueryRecentChangesIntegrationTest.php index ff0e2e69a8e..c96f28efeed 100644 --- a/tests/phpunit/includes/api/ApiQueryRecentChangesIntegrationTest.php +++ b/tests/phpunit/includes/api/ApiQueryRecentChangesIntegrationTest.php @@ -19,7 +19,7 @@ class ApiQueryRecentChangesIntegrationTest extends ApiTestCase { $this->tablesUsed[] = 'page'; } - protected function setUp() { + protected function setUp() : void { parent::setUp(); self::$users['ApiQueryRecentChangesIntegrationTestUser'] = $this->getMutableTestUser(); diff --git a/tests/phpunit/includes/api/ApiQuerySearchTest.php b/tests/phpunit/includes/api/ApiQuerySearchTest.php index cf835ced0b1..8666977d579 100644 --- a/tests/phpunit/includes/api/ApiQuerySearchTest.php +++ b/tests/phpunit/includes/api/ApiQuerySearchTest.php @@ -93,7 +93,7 @@ class ApiQuerySearchTest extends ApiTestCase { $this->assertEquals( $expect, $results ); } - public function setUp() { + public function setUp() : void { parent::setUp(); MockSearchEngine::clearMockResults(); $this->registerMockSearchEngine(); diff --git a/tests/phpunit/includes/api/ApiQueryWatchlistIntegrationTest.php b/tests/phpunit/includes/api/ApiQueryWatchlistIntegrationTest.php index 7018ee306ba..02c2a56e89f 100644 --- a/tests/phpunit/includes/api/ApiQueryWatchlistIntegrationTest.php +++ b/tests/phpunit/includes/api/ApiQueryWatchlistIntegrationTest.php @@ -20,7 +20,7 @@ class ApiQueryWatchlistIntegrationTest extends ApiTestCase { ); } - protected function setUp() { + protected function setUp() : void { parent::setUp(); self::$users['ApiQueryWatchlistIntegrationTestUser'] = $this->getMutableTestUser(); self::$users['ApiQueryWatchlistIntegrationTestUser2'] = $this->getMutableTestUser(); diff --git a/tests/phpunit/includes/api/ApiQueryWatchlistRawIntegrationTest.php b/tests/phpunit/includes/api/ApiQueryWatchlistRawIntegrationTest.php index 4ebaa0dc811..f42ce9b8c27 100644 --- a/tests/phpunit/includes/api/ApiQueryWatchlistRawIntegrationTest.php +++ b/tests/phpunit/includes/api/ApiQueryWatchlistRawIntegrationTest.php @@ -11,7 +11,7 @@ use MediaWiki\MediaWikiServices; */ class ApiQueryWatchlistRawIntegrationTest extends ApiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); self::$users['ApiQueryWatchlistRawIntegrationTestUser'] = $this->getMutableTestUser(); diff --git a/tests/phpunit/includes/api/ApiRevisionDeleteTest.php b/tests/phpunit/includes/api/ApiRevisionDeleteTest.php index 7dc63fbe9ed..25bd6e94765 100644 --- a/tests/phpunit/includes/api/ApiRevisionDeleteTest.php +++ b/tests/phpunit/includes/api/ApiRevisionDeleteTest.php @@ -15,7 +15,7 @@ class ApiRevisionDeleteTest extends ApiTestCase { public static $page = 'Help:ApiRevDel_test'; public $revs = []; - protected function setUp() { + protected function setUp() : void { // Needs to be before setup since this gets cached $this->mergeMwGlobalArrayValue( 'wgGroupPermissions', diff --git a/tests/phpunit/includes/api/ApiSetNotificationTimestampIntegrationTest.php b/tests/phpunit/includes/api/ApiSetNotificationTimestampIntegrationTest.php index 187e9e083ba..610b30a7f20 100644 --- a/tests/phpunit/includes/api/ApiSetNotificationTimestampIntegrationTest.php +++ b/tests/phpunit/includes/api/ApiSetNotificationTimestampIntegrationTest.php @@ -11,7 +11,7 @@ use MediaWiki\MediaWikiServices; */ class ApiSetNotificationTimestampIntegrationTest extends ApiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); self::$users[__CLASS__] = new TestUser( __CLASS__ ); } diff --git a/tests/phpunit/includes/api/ApiStashEditTest.php b/tests/phpunit/includes/api/ApiStashEditTest.php index ecb7e1ec419..a5c39c4b50c 100644 --- a/tests/phpunit/includes/api/ApiStashEditTest.php +++ b/tests/phpunit/includes/api/ApiStashEditTest.php @@ -13,7 +13,7 @@ use Psr\Log\NullLogger; * @group Database */ class ApiStashEditTest extends ApiTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); $this->setService( 'PageEditStash', new PageEditStash( new HashBagOStuff( [] ), @@ -26,7 +26,7 @@ class ApiStashEditTest extends ApiTestCase { $this->setMwGlobals( 'wgMainCacheType', 'hash' ); } - public function tearDown() { + public function tearDown() : void { parent::tearDown(); } diff --git a/tests/phpunit/includes/api/ApiTestCase.php b/tests/phpunit/includes/api/ApiTestCase.php index f0de8ba7da3..05ef71498f1 100644 --- a/tests/phpunit/includes/api/ApiTestCase.php +++ b/tests/phpunit/includes/api/ApiTestCase.php @@ -15,7 +15,7 @@ abstract class ApiTestCase extends MediaWikiLangTestCase { */ protected $apiContext; - protected function setUp() { + protected function setUp() : void { global $wgServer; parent::setUp(); @@ -36,7 +36,7 @@ abstract class ApiTestCase extends MediaWikiLangTestCase { $this->apiContext = new ApiTestContext(); } - protected function tearDown() { + protected function tearDown() : void { // Avoid leaking session over tests MediaWiki\Session\SessionManager::getGlobalSession()->clear(); diff --git a/tests/phpunit/includes/api/ApiUnblockTest.php b/tests/phpunit/includes/api/ApiUnblockTest.php index 4a73872fd7d..0ab2ddf5e6b 100644 --- a/tests/phpunit/includes/api/ApiUnblockTest.php +++ b/tests/phpunit/includes/api/ApiUnblockTest.php @@ -16,7 +16,7 @@ class ApiUnblockTest extends ApiTestCase { /** @var User */ private $blockee; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->tablesUsed = array_merge( diff --git a/tests/phpunit/includes/api/ApiUploadTest.php b/tests/phpunit/includes/api/ApiUploadTest.php index 8b18e32043c..4e1f46512bb 100644 --- a/tests/phpunit/includes/api/ApiUploadTest.php +++ b/tests/phpunit/includes/api/ApiUploadTest.php @@ -12,7 +12,7 @@ class ApiUploadTest extends ApiUploadTestCase { return __DIR__ . '/../../data/media/' . $fileName; } - public function setUp() { + public function setUp() : void { parent::setUp(); $this->tablesUsed[] = 'watchlist'; // This test might interfere with watchlists test. $this->tablesUsed = array_merge( $this->tablesUsed, LocalFile::getQueryInfo()['tables'] ); diff --git a/tests/phpunit/includes/api/ApiUploadTestCase.php b/tests/phpunit/includes/api/ApiUploadTestCase.php index d36f0144ad0..2ba2f99b455 100644 --- a/tests/phpunit/includes/api/ApiUploadTestCase.php +++ b/tests/phpunit/includes/api/ApiUploadTestCase.php @@ -7,7 +7,7 @@ abstract class ApiUploadTestCase extends ApiTestCase { /** * Fixture -- run before every test */ - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/api/ApiUserrightsTest.php b/tests/phpunit/includes/api/ApiUserrightsTest.php index 5f78ac6ef36..c17d95da273 100644 --- a/tests/phpunit/includes/api/ApiUserrightsTest.php +++ b/tests/phpunit/includes/api/ApiUserrightsTest.php @@ -12,7 +12,7 @@ use MediaWiki\MediaWikiServices; */ class ApiUserrightsTest extends ApiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->tablesUsed = array_merge( $this->tablesUsed, diff --git a/tests/phpunit/includes/api/format/ApiFormatBaseTest.php b/tests/phpunit/includes/api/format/ApiFormatBaseTest.php index 3cdb0f1fd2c..68078a78deb 100644 --- a/tests/phpunit/includes/api/format/ApiFormatBaseTest.php +++ b/tests/phpunit/includes/api/format/ApiFormatBaseTest.php @@ -10,7 +10,7 @@ class ApiFormatBaseTest extends ApiFormatTestBase { protected $printerName = 'mockbase'; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ 'wgServer' => 'http://example.org' diff --git a/tests/phpunit/includes/api/query/ApiQueryTest.php b/tests/phpunit/includes/api/query/ApiQueryTest.php index 9ed37542ade..132f0db3046 100644 --- a/tests/phpunit/includes/api/query/ApiQueryTest.php +++ b/tests/phpunit/includes/api/query/ApiQueryTest.php @@ -7,7 +7,7 @@ * @covers ApiQuery */ class ApiQueryTest extends ApiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); // Setup apiquerytestiw: as interwiki prefix diff --git a/tests/phpunit/includes/auth/UserDataAuthenticationRequestTest.php b/tests/phpunit/includes/auth/UserDataAuthenticationRequestTest.php index 8c9a88f7787..4114e189511 100644 --- a/tests/phpunit/includes/auth/UserDataAuthenticationRequestTest.php +++ b/tests/phpunit/includes/auth/UserDataAuthenticationRequestTest.php @@ -12,7 +12,7 @@ class UserDataAuthenticationRequestTest extends AuthenticationRequestTestCase { return new UserDataAuthenticationRequest; } - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( 'wgHiddenPrefs', [] ); } diff --git a/tests/phpunit/includes/block/BlockManagerTest.php b/tests/phpunit/includes/block/BlockManagerTest.php index d50bf43b680..c4e1a79efda 100644 --- a/tests/phpunit/includes/block/BlockManagerTest.php +++ b/tests/phpunit/includes/block/BlockManagerTest.php @@ -22,7 +22,7 @@ class BlockManagerTest extends MediaWikiTestCase { /** @var int */ protected $sysopId; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->user = $this->getTestUser()->getUser(); diff --git a/tests/phpunit/includes/block/BlockRestrictionStoreTest.php b/tests/phpunit/includes/block/BlockRestrictionStoreTest.php index b1e23baabf0..523ca33b164 100644 --- a/tests/phpunit/includes/block/BlockRestrictionStoreTest.php +++ b/tests/phpunit/includes/block/BlockRestrictionStoreTest.php @@ -19,13 +19,13 @@ class BlockRestrictionStoreTest extends \MediaWikiLangTestCase { /** @var BlockRestrictionStore */ protected $blockRestrictionStore; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->blockRestrictionStore = MediaWikiServices::getInstance()->getBlockRestrictionStore(); } - public function tearDown() { + public function tearDown() : void { parent::tearDown(); $this->resetTables(); } diff --git a/tests/phpunit/includes/cache/LocalisationCacheTest.php b/tests/phpunit/includes/cache/LocalisationCacheTest.php index 4dd819a61b8..163e0a99d8c 100644 --- a/tests/phpunit/includes/cache/LocalisationCacheTest.php +++ b/tests/phpunit/includes/cache/LocalisationCacheTest.php @@ -11,7 +11,7 @@ use Psr\Log\NullLogger; * @author Niklas Laxström */ class LocalisationCacheTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ 'wgExtensionMessagesFiles' => [], diff --git a/tests/phpunit/includes/cache/MessageCacheTest.php b/tests/phpunit/includes/cache/MessageCacheTest.php index e786f42ae97..e3c11a6132f 100644 --- a/tests/phpunit/includes/cache/MessageCacheTest.php +++ b/tests/phpunit/includes/cache/MessageCacheTest.php @@ -10,7 +10,7 @@ use Wikimedia\TestingAccessWrapper; */ class MessageCacheTest extends MediaWikiLangTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->configureLanguages(); MessageCache::singleton()->enable(); diff --git a/tests/phpunit/includes/changes/CategoryMembershipChangeTest.php b/tests/phpunit/includes/changes/CategoryMembershipChangeTest.php index 955971d5a4d..80ffcdeb151 100644 --- a/tests/phpunit/includes/changes/CategoryMembershipChangeTest.php +++ b/tests/phpunit/includes/changes/CategoryMembershipChangeTest.php @@ -45,7 +45,7 @@ class CategoryMembershipChangeTest extends MediaWikiLangTestCase { return self::$mockRecentChange; } - public function setUp() { + public function setUp() : void { parent::setUp(); self::$notifyCallCounter = 0; self::$mockRecentChange = $this->createMock( RecentChange::class ); diff --git a/tests/phpunit/includes/changes/ChangesListFilterTest.php b/tests/phpunit/includes/changes/ChangesListFilterTest.php index 6574e12f8f1..46372b1898e 100644 --- a/tests/phpunit/includes/changes/ChangesListFilterTest.php +++ b/tests/phpunit/includes/changes/ChangesListFilterTest.php @@ -8,7 +8,7 @@ use Wikimedia\TestingAccessWrapper; class ChangesListFilterTest extends MediaWikiTestCase { protected $group; - public function setUp() { + public function setUp() : void { $this->group = $this->getGroup( [ 'name' => 'group' ] ); parent::setUp(); diff --git a/tests/phpunit/includes/changes/OldChangesListTest.php b/tests/phpunit/includes/changes/OldChangesListTest.php index f4048b4f0a8..1fab370b228 100644 --- a/tests/phpunit/includes/changes/OldChangesListTest.php +++ b/tests/phpunit/includes/changes/OldChangesListTest.php @@ -24,7 +24,7 @@ class OldChangesListTest extends MediaWikiLangTestCase { $this->testRecentChangesHelper = new TestRecentChangesHelper(); } - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php b/tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php index 558706d757d..016b5ae190d 100644 --- a/tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php +++ b/tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php @@ -28,7 +28,7 @@ class RCCacheEntryFactoryTest extends MediaWikiLangTestCase { $this->testRecentChangesHelper = new TestRecentChangesHelper(); } - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/changes/RecentChangeTest.php b/tests/phpunit/includes/changes/RecentChangeTest.php index 491d3728ec5..eeca4b550f5 100644 --- a/tests/phpunit/includes/changes/RecentChangeTest.php +++ b/tests/phpunit/includes/changes/RecentChangeTest.php @@ -13,7 +13,7 @@ class RecentChangeTest extends MediaWikiTestCase { protected $user_comment; protected $context; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->title = Title::newFromText( 'SomeTitle' ); diff --git a/tests/phpunit/includes/changetags/ChangeTagsTest.php b/tests/phpunit/includes/changetags/ChangeTagsTest.php index ad31dce3767..d98fbe8d4ee 100644 --- a/tests/phpunit/includes/changetags/ChangeTagsTest.php +++ b/tests/phpunit/includes/changetags/ChangeTagsTest.php @@ -8,7 +8,7 @@ use MediaWiki\MediaWikiServices; */ class ChangeTagsTest extends MediaWikiTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); $this->tablesUsed[] = 'change_tag'; diff --git a/tests/phpunit/includes/collation/CollationTest.php b/tests/phpunit/includes/collation/CollationTest.php index e97f14a5107..e81520718b9 100644 --- a/tests/phpunit/includes/collation/CollationTest.php +++ b/tests/phpunit/includes/collation/CollationTest.php @@ -8,7 +8,7 @@ * @covers UppercaseCollation */ class CollationTest extends MediaWikiLangTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->checkPHPExtension( 'intl' ); } diff --git a/tests/phpunit/includes/collation/CustomUppercaseCollationTest.php b/tests/phpunit/includes/collation/CustomUppercaseCollationTest.php index 9e42d3f312e..9bda6c23182 100644 --- a/tests/phpunit/includes/collation/CustomUppercaseCollationTest.php +++ b/tests/phpunit/includes/collation/CustomUppercaseCollationTest.php @@ -7,7 +7,7 @@ use MediaWiki\MediaWikiServices; */ class CustomUppercaseCollationTest extends MediaWikiTestCase { - public function setUp() { + public function setUp() : void { $this->collation = new CustomUppercaseCollation( [ 'D', 'C', diff --git a/tests/phpunit/includes/content/ContentHandlerTest.php b/tests/phpunit/includes/content/ContentHandlerTest.php index 99ea782c376..2d5ee2fcf50 100644 --- a/tests/phpunit/includes/content/ContentHandlerTest.php +++ b/tests/phpunit/includes/content/ContentHandlerTest.php @@ -9,7 +9,7 @@ use Wikimedia\TestingAccessWrapper; */ class ContentHandlerTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ @@ -39,7 +39,7 @@ class ContentHandlerTest extends MediaWikiTestCase { MediaWikiServices::getInstance()->resetServiceForTesting( 'LinkCache' ); } - protected function tearDown() { + protected function tearDown() : void { // Reset LinkCache MediaWikiServices::getInstance()->resetServiceForTesting( 'LinkCache' ); diff --git a/tests/phpunit/includes/content/CssContentTest.php b/tests/phpunit/includes/content/CssContentTest.php index 1b5b976b349..d844fc7a3b2 100644 --- a/tests/phpunit/includes/content/CssContentTest.php +++ b/tests/phpunit/includes/content/CssContentTest.php @@ -9,7 +9,7 @@ */ class CssContentTest extends JavaScriptContentTest { - protected function setUp() { + protected function setUp() : void { parent::setUp(); // Anon user diff --git a/tests/phpunit/includes/content/FileContentHandlerTest.php b/tests/phpunit/includes/content/FileContentHandlerTest.php index 9149fc4f57f..b840960361f 100644 --- a/tests/phpunit/includes/content/FileContentHandlerTest.php +++ b/tests/phpunit/includes/content/FileContentHandlerTest.php @@ -11,7 +11,7 @@ class FileContentHandlerTest extends MediaWikiLangTestCase { */ private $handler; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->handler = new FileContentHandler(); diff --git a/tests/phpunit/includes/content/TextContentTest.php b/tests/phpunit/includes/content/TextContentTest.php index ecd23f13381..777352bc0b0 100644 --- a/tests/phpunit/includes/content/TextContentTest.php +++ b/tests/phpunit/includes/content/TextContentTest.php @@ -10,7 +10,7 @@ use MediaWiki\MediaWikiServices; class TextContentTest extends MediaWikiLangTestCase { protected $context; - protected function setUp() { + protected function setUp() : void { parent::setUp(); // trigger purging of all page related tables @@ -40,7 +40,7 @@ class TextContentTest extends MediaWikiLangTestCase { MWTidy::destroySingleton(); } - protected function tearDown() { + protected function tearDown() : void { MWTidy::destroySingleton(); parent::tearDown(); } diff --git a/tests/phpunit/includes/content/WikitextContentHandlerTest.php b/tests/phpunit/includes/content/WikitextContentHandlerTest.php index 386c146ad8b..bb287ddc055 100644 --- a/tests/phpunit/includes/content/WikitextContentHandlerTest.php +++ b/tests/phpunit/includes/content/WikitextContentHandlerTest.php @@ -13,7 +13,7 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase { */ private $handler; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->handler = ContentHandler::getForModelID( CONTENT_MODEL_WIKITEXT ); diff --git a/tests/phpunit/includes/debug/DeprecationHelperTest.php b/tests/phpunit/includes/debug/DeprecationHelperTest.php index 2e4255329a4..2c746c5b503 100644 --- a/tests/phpunit/includes/debug/DeprecationHelperTest.php +++ b/tests/phpunit/includes/debug/DeprecationHelperTest.php @@ -13,7 +13,7 @@ class DeprecationHelperTest extends MediaWikiTestCase { /** @var TestDeprecatedSubclass */ private $testSubclass; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->testClass = new TestDeprecatedClass(); $this->testSubclass = new TestDeprecatedSubclass(); diff --git a/tests/phpunit/includes/debug/MWDebugTest.php b/tests/phpunit/includes/debug/MWDebugTest.php index 6f0b1db9f25..216029d403d 100644 --- a/tests/phpunit/includes/debug/MWDebugTest.php +++ b/tests/phpunit/includes/debug/MWDebugTest.php @@ -2,7 +2,7 @@ class MWDebugTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); /** Clear log before each test */ MWDebug::clearLog(); diff --git a/tests/phpunit/includes/deferred/LinksUpdateTest.php b/tests/phpunit/includes/deferred/LinksUpdateTest.php index 6ae510aa318..84bd88802b9 100644 --- a/tests/phpunit/includes/deferred/LinksUpdateTest.php +++ b/tests/phpunit/includes/deferred/LinksUpdateTest.php @@ -28,7 +28,7 @@ class LinksUpdateTest extends MediaWikiLangTestCase { ); } - protected function setUp() { + protected function setUp() : void { parent::setUp(); $dbw = wfGetDB( DB_MASTER ); $dbw->replace( diff --git a/tests/phpunit/includes/deferred/SearchUpdateTest.php b/tests/phpunit/includes/deferred/SearchUpdateTest.php index 43fbee80075..4b9ad05bb1e 100644 --- a/tests/phpunit/includes/deferred/SearchUpdateTest.php +++ b/tests/phpunit/includes/deferred/SearchUpdateTest.php @@ -10,7 +10,7 @@ class SearchUpdateTest extends MediaWikiTestCase { */ private $su; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->su = new SearchUpdate( 0, Title::newMainPage() ); } diff --git a/tests/phpunit/includes/diff/DifferenceEngineTest.php b/tests/phpunit/includes/diff/DifferenceEngineTest.php index 842d692a3b7..79ed62cc40b 100644 --- a/tests/phpunit/includes/diff/DifferenceEngineTest.php +++ b/tests/phpunit/includes/diff/DifferenceEngineTest.php @@ -21,7 +21,7 @@ class DifferenceEngineTest extends MediaWikiTestCase { private static $revisions; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $title = $this->getTitle(); diff --git a/tests/phpunit/includes/filebackend/FileBackendIntegrationTest.php b/tests/phpunit/includes/filebackend/FileBackendIntegrationTest.php index b8ca41d4a58..b0e3fa72fcf 100644 --- a/tests/phpunit/includes/filebackend/FileBackendIntegrationTest.php +++ b/tests/phpunit/includes/filebackend/FileBackendIntegrationTest.php @@ -54,7 +54,7 @@ class FileBackendIntegrationTest extends MediaWikiIntegrationTestCase { public $singleBackend; private static $backendToUse; - protected function setUp() { + protected function setUp() : void { global $wgFileBackends; parent::setUp(); $tmpDir = $this->getNewTempDirectory(); diff --git a/tests/phpunit/includes/filebackend/SwiftFileBackendTest.php b/tests/phpunit/includes/filebackend/SwiftFileBackendTest.php index 13f2b175788..1619779a51b 100644 --- a/tests/phpunit/includes/filebackend/SwiftFileBackendTest.php +++ b/tests/phpunit/includes/filebackend/SwiftFileBackendTest.php @@ -16,7 +16,7 @@ class SwiftFileBackendTest extends MediaWikiTestCase { /** @var TestingAccessWrapper|SwiftFileBackend */ private $backend; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->backend = TestingAccessWrapper::newFromObject( diff --git a/tests/phpunit/includes/filebackend/filejournal/DBFileJournalIntegrationTest.php b/tests/phpunit/includes/filebackend/filejournal/DBFileJournalIntegrationTest.php index 9a0ba1c5749..8c4a453575d 100644 --- a/tests/phpunit/includes/filebackend/filejournal/DBFileJournalIntegrationTest.php +++ b/tests/phpunit/includes/filebackend/filejournal/DBFileJournalIntegrationTest.php @@ -21,7 +21,7 @@ class DBFileJournalIntegrationTest extends MediaWikiIntegrationTestCase { } } - protected function setUp() { + protected function setUp() : void { parent::setUp(); $db = MediaWikiServices::getInstance()->getDBLoadBalancer()->getConnection( DB_MASTER ); diff --git a/tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php b/tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php index 0c78c2bd86f..247089df2a6 100644 --- a/tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php +++ b/tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php @@ -9,7 +9,7 @@ class MigrateFileRepoLayoutTest extends MediaWikiTestCase { protected $tmpFilepath; protected $text = 'testing'; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $filename = 'Foo.png'; @@ -91,7 +91,7 @@ class MigrateFileRepoLayoutTest extends MediaWikiTestCase { rmdir( $directory ); } - protected function tearDown() { + protected function tearDown() : void { foreach ( glob( $this->tmpPrefix . '*' ) as $directory ) { $this->deleteFilesRecursively( $directory ); } diff --git a/tests/phpunit/includes/filerepo/StoreBatchTest.php b/tests/phpunit/includes/filerepo/StoreBatchTest.php index 337c65c4b76..fb13b42a67b 100644 --- a/tests/phpunit/includes/filerepo/StoreBatchTest.php +++ b/tests/phpunit/includes/filerepo/StoreBatchTest.php @@ -11,7 +11,7 @@ class StoreBatchTest extends MediaWikiTestCase { /** @var FileRepo */ protected $repo; - protected function setUp() { + protected function setUp() : void { global $wgFileBackends; parent::setUp(); @@ -51,7 +51,7 @@ class StoreBatchTest extends MediaWikiTestCase { $this->createdFiles = []; } - protected function tearDown() { + protected function tearDown() : void { // Delete files $this->repo->cleanupBatch( $this->createdFiles ); parent::tearDown(); diff --git a/tests/phpunit/includes/import/ImportLinkCacheIntegrationTest.php b/tests/phpunit/includes/import/ImportLinkCacheIntegrationTest.php index 7d1d1a2f13b..195c6382387 100644 --- a/tests/phpunit/includes/import/ImportLinkCacheIntegrationTest.php +++ b/tests/phpunit/includes/import/ImportLinkCacheIntegrationTest.php @@ -17,7 +17,7 @@ class ImportLinkCacheIntegrationTest extends MediaWikiTestCase { private $importStreamSource; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $file = dirname( __DIR__ ) . '/../data/import/ImportLinkCacheIntegrationTest.xml'; diff --git a/tests/phpunit/includes/import/ImportableOldRevisionImporterTest.php b/tests/phpunit/includes/import/ImportableOldRevisionImporterTest.php index a68ac83d2fd..fdfa85b8c33 100644 --- a/tests/phpunit/includes/import/ImportableOldRevisionImporterTest.php +++ b/tests/phpunit/includes/import/ImportableOldRevisionImporterTest.php @@ -9,7 +9,7 @@ use Psr\Log\NullLogger; */ class ImportableOldRevisionImporterTest extends MediaWikiIntegrationTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); $this->tablesUsed[] = 'change_tag'; diff --git a/tests/phpunit/includes/jobqueue/JobQueueTest.php b/tests/phpunit/includes/jobqueue/JobQueueTest.php index fd73f8b2cdc..3210dc14629 100644 --- a/tests/phpunit/includes/jobqueue/JobQueueTest.php +++ b/tests/phpunit/includes/jobqueue/JobQueueTest.php @@ -17,7 +17,7 @@ class JobQueueTest extends MediaWikiTestCase { $this->tablesUsed[] = 'job'; } - protected function setUp() { + protected function setUp() : void { global $wgJobTypeConf; parent::setUp(); @@ -52,7 +52,7 @@ class JobQueueTest extends MediaWikiTestCase { } } - protected function tearDown() { + protected function tearDown() : void { parent::tearDown(); foreach ( [ diff --git a/tests/phpunit/includes/jobqueue/jobs/CategoryMembershipChangeJobTest.php b/tests/phpunit/includes/jobqueue/jobs/CategoryMembershipChangeJobTest.php index 673808d31a8..d8a262cdb80 100644 --- a/tests/phpunit/includes/jobqueue/jobs/CategoryMembershipChangeJobTest.php +++ b/tests/phpunit/includes/jobqueue/jobs/CategoryMembershipChangeJobTest.php @@ -20,7 +20,7 @@ class CategoryMembershipChangeJobTest extends MediaWikiTestCase { */ private $title; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->setMwGlobals( 'wgRCWatchCategoryMembership', true ); $this->setContentLang( 'qqx' ); diff --git a/tests/phpunit/includes/jobqueue/jobs/ClearUserWatchlistJobTest.php b/tests/phpunit/includes/jobqueue/jobs/ClearUserWatchlistJobTest.php index c7596bf46f8..5fd6ea8f860 100644 --- a/tests/phpunit/includes/jobqueue/jobs/ClearUserWatchlistJobTest.php +++ b/tests/phpunit/includes/jobqueue/jobs/ClearUserWatchlistJobTest.php @@ -13,7 +13,7 @@ use MediaWiki\MediaWikiServices; */ class ClearUserWatchlistJobTest extends MediaWikiTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); self::$users['ClearUserWatchlistJobTestUser'] = new TestUser( 'ClearUserWatchlistJobTestUser' ); diff --git a/tests/phpunit/includes/jobqueue/jobs/RefreshLinksJobTest.php b/tests/phpunit/includes/jobqueue/jobs/RefreshLinksJobTest.php index 24ec2e40fd5..b74ce047dcf 100644 --- a/tests/phpunit/includes/jobqueue/jobs/RefreshLinksJobTest.php +++ b/tests/phpunit/includes/jobqueue/jobs/RefreshLinksJobTest.php @@ -13,7 +13,7 @@ use MediaWiki\MediaWikiServices; */ class RefreshLinksJobTest extends MediaWikiTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); $this->tablesUsed[] = 'page'; diff --git a/tests/phpunit/includes/language/ConverterRuleTest.php b/tests/phpunit/includes/language/ConverterRuleTest.php index 1e06142887d..0aeac9b5387 100644 --- a/tests/phpunit/includes/language/ConverterRuleTest.php +++ b/tests/phpunit/includes/language/ConverterRuleTest.php @@ -5,7 +5,7 @@ */ class ConverterRuleTest extends MediaWikiTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); $this->setMwGlobals( 'wgUser', new User ); } diff --git a/tests/phpunit/includes/libs/CSSMinTest.php b/tests/phpunit/includes/libs/CSSMinTest.php index 5e6f4fa651f..ace1c44ca7d 100644 --- a/tests/phpunit/includes/libs/CSSMinTest.php +++ b/tests/phpunit/includes/libs/CSSMinTest.php @@ -8,7 +8,7 @@ use Wikimedia\TestingAccessWrapper; */ class CSSMinTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); // For wfExpandUrl diff --git a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php index d57d0dd553c..3dd81ebd3e4 100644 --- a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php +++ b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php @@ -4,7 +4,7 @@ class JavaScriptMinifierTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; - protected function tearDown() { + protected function tearDown() : void { parent::tearDown(); // Reset $this->setMaxLineLength( 1000 ); diff --git a/tests/phpunit/includes/libs/composer/ComposerInstalledTest.php b/tests/phpunit/includes/libs/composer/ComposerInstalledTest.php index ae022486d30..5e57cfede55 100644 --- a/tests/phpunit/includes/libs/composer/ComposerInstalledTest.php +++ b/tests/phpunit/includes/libs/composer/ComposerInstalledTest.php @@ -4,7 +4,7 @@ class ComposerInstalledTest extends PHPUnit\Framework\TestCase { private $installed; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->installed = __DIR__ . "/../../../data/composer/installed.json"; } diff --git a/tests/phpunit/includes/libs/composer/ComposerJsonTest.php b/tests/phpunit/includes/libs/composer/ComposerJsonTest.php index 720fa6e8fd1..d6552b3054f 100644 --- a/tests/phpunit/includes/libs/composer/ComposerJsonTest.php +++ b/tests/phpunit/includes/libs/composer/ComposerJsonTest.php @@ -4,7 +4,7 @@ class ComposerJsonTest extends PHPUnit\Framework\TestCase { private $json, $json2; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->json = __DIR__ . "/../../../data/composer/composer.json"; $this->json2 = __DIR__ . "/../../../data/composer/new-composer.json"; diff --git a/tests/phpunit/includes/libs/composer/ComposerLockTest.php b/tests/phpunit/includes/libs/composer/ComposerLockTest.php index f5fcdbe0181..b1e61a7d536 100644 --- a/tests/phpunit/includes/libs/composer/ComposerLockTest.php +++ b/tests/phpunit/includes/libs/composer/ComposerLockTest.php @@ -4,7 +4,7 @@ class ComposerLockTest extends PHPUnit\Framework\TestCase { private $lock; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->lock = __DIR__ . "/../../../data/composer/composer.lock"; } diff --git a/tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php b/tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php index ec6d1404e69..4547fe69385 100644 --- a/tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php +++ b/tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php @@ -10,7 +10,7 @@ class MimeAnalyzerTest extends PHPUnit\Framework\TestCase { /** @var MimeAnalyzer */ private $mimeAnalyzer; - public function setUp() { + public function setUp() : void { global $IP; $this->mimeAnalyzer = new MimeAnalyzer( [ diff --git a/tests/phpunit/includes/libs/objectcache/BagOStuffTest.php b/tests/phpunit/includes/libs/objectcache/BagOStuffTest.php index d239ac1bd7a..5c54b783174 100644 --- a/tests/phpunit/includes/libs/objectcache/BagOStuffTest.php +++ b/tests/phpunit/includes/libs/objectcache/BagOStuffTest.php @@ -14,7 +14,7 @@ class BagOStuffTest extends MediaWikiTestCase { const TEST_KEY = 'test'; - protected function setUp() { + protected function setUp() : void { parent::setUp(); // type defined through parameter @@ -499,7 +499,7 @@ class BagOStuffTest extends MediaWikiTestCase { $this->assertTrue( $this->cache->unlock( $key2 ) ); } - public function tearDown() { + public function tearDown() : void { $this->cache->delete( $this->cache->makeKey( self::TEST_KEY ) ); $this->cache->delete( $this->cache->makeKey( self::TEST_KEY ) . ':lock' ); diff --git a/tests/phpunit/includes/libs/objectcache/MultiWriteBagOStuffTest.php b/tests/phpunit/includes/libs/objectcache/MultiWriteBagOStuffTest.php index 9f88474e7b2..d2a71bf5c79 100644 --- a/tests/phpunit/includes/libs/objectcache/MultiWriteBagOStuffTest.php +++ b/tests/phpunit/includes/libs/objectcache/MultiWriteBagOStuffTest.php @@ -11,7 +11,7 @@ class MultiWriteBagOStuffTest extends MediaWikiTestCase { /** @var MultiWriteBagOStuff */ private $cache; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->cache1 = new HashBagOStuff(); diff --git a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php index ae13e7c07d8..d05b6c10ea3 100644 --- a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php +++ b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php @@ -25,7 +25,7 @@ class WANObjectCacheTest extends PHPUnit\Framework\TestCase { /** @var BagOStuff */ private $internalCache; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->cache = new WANObjectCache( [ diff --git a/tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php b/tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php index 6c89db5ce97..1c6bace4307 100644 --- a/tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php +++ b/tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php @@ -19,7 +19,7 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase { /** @var DatabaseTestHelper|Database */ private $database; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->database = new DatabaseTestHelper( __CLASS__, [ 'cliMode' => true ] ); } diff --git a/tests/phpunit/includes/libs/rdbms/database/DatabaseTest.php b/tests/phpunit/includes/libs/rdbms/database/DatabaseTest.php index f7cafcd5a6c..ae2fcd44313 100644 --- a/tests/phpunit/includes/libs/rdbms/database/DatabaseTest.php +++ b/tests/phpunit/includes/libs/rdbms/database/DatabaseTest.php @@ -17,7 +17,7 @@ class DatabaseTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; - protected function setUp() { + protected function setUp() : void { $this->db = new DatabaseTestHelper( __CLASS__ . '::' . $this->getName() ); } diff --git a/tests/phpunit/includes/linkeddata/PageDataRequestHandlerTest.php b/tests/phpunit/includes/linkeddata/PageDataRequestHandlerTest.php index e3a200b2e95..e08e13f90ce 100644 --- a/tests/phpunit/includes/linkeddata/PageDataRequestHandlerTest.php +++ b/tests/phpunit/includes/linkeddata/PageDataRequestHandlerTest.php @@ -16,7 +16,7 @@ class PageDataRequestHandlerTest extends \MediaWikiLangTestCase { */ private $obLevel; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->interfaceTitle = Title::newFromText( __CLASS__ ); @@ -25,7 +25,7 @@ class PageDataRequestHandlerTest extends \MediaWikiLangTestCase { $this->setMwGlobals( 'wgArticlePath', '/wiki/$1' ); } - protected function tearDown() { + protected function tearDown() : void { $obLevel = ob_get_level(); while ( ob_get_level() > $this->obLevel ) { diff --git a/tests/phpunit/includes/linker/LinkRendererFactoryTest.php b/tests/phpunit/includes/linker/LinkRendererFactoryTest.php index ef023da19e6..f77bfac8158 100644 --- a/tests/phpunit/includes/linker/LinkRendererFactoryTest.php +++ b/tests/phpunit/includes/linker/LinkRendererFactoryTest.php @@ -25,7 +25,7 @@ class LinkRendererFactoryTest extends MediaWikiLangTestCase { */ private $nsInfo; - public function setUp() { + public function setUp() : void { parent::setUp(); $services = MediaWikiServices::getInstance(); diff --git a/tests/phpunit/includes/linker/LinkRendererTest.php b/tests/phpunit/includes/linker/LinkRendererTest.php index d359988a67b..a46bbf69807 100644 --- a/tests/phpunit/includes/linker/LinkRendererTest.php +++ b/tests/phpunit/includes/linker/LinkRendererTest.php @@ -14,7 +14,7 @@ class LinkRendererTest extends MediaWikiLangTestCase { */ private $factory; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->setMwGlobals( [ 'wgArticlePath' => '/wiki/$1', @@ -192,7 +192,7 @@ class LinkRendererTest extends MediaWikiLangTestCase { ); } - public function tearDown() { + public function tearDown() : void { Title::clearCaches(); parent::tearDown(); } diff --git a/tests/phpunit/includes/logging/DatabaseLogEntryTest.php b/tests/phpunit/includes/logging/DatabaseLogEntryTest.php index 3d2214cdc0c..c3add61ba8c 100644 --- a/tests/phpunit/includes/logging/DatabaseLogEntryTest.php +++ b/tests/phpunit/includes/logging/DatabaseLogEntryTest.php @@ -4,7 +4,7 @@ use MediaWiki\MediaWikiServices; use Wikimedia\Rdbms\IDatabase; class DatabaseLogEntryTest extends MediaWikiTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); // These services cache their joins @@ -12,7 +12,7 @@ class DatabaseLogEntryTest extends MediaWikiTestCase { MediaWikiServices::getInstance()->resetServiceForTesting( 'ActorMigration' ); } - public function tearDown() { + public function tearDown() : void { parent::tearDown(); MediaWikiServices::getInstance()->resetServiceForTesting( 'CommentStore' ); diff --git a/tests/phpunit/includes/logging/LogFormatterTest.php b/tests/phpunit/includes/logging/LogFormatterTest.php index 0eb723bb6ff..c0043f8a72a 100644 --- a/tests/phpunit/includes/logging/LogFormatterTest.php +++ b/tests/phpunit/includes/logging/LogFormatterTest.php @@ -48,7 +48,7 @@ class LogFormatterTest extends MediaWikiLangTestCase { parent::tearDownAfterClass(); } - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/logging/NewUsersLogFormatterTest.php b/tests/phpunit/includes/logging/NewUsersLogFormatterTest.php index eee2981c185..407b7732f78 100644 --- a/tests/phpunit/includes/logging/NewUsersLogFormatterTest.php +++ b/tests/phpunit/includes/logging/NewUsersLogFormatterTest.php @@ -6,7 +6,7 @@ */ class NewUsersLogFormatterTest extends LogFormatterTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); // Register LogHandler, see $wgNewUserLog in Setup.php diff --git a/tests/phpunit/includes/logging/PageLangLogFormatterTest.php b/tests/phpunit/includes/logging/PageLangLogFormatterTest.php index 33fd68f6c3d..51f3b0dc6dc 100644 --- a/tests/phpunit/includes/logging/PageLangLogFormatterTest.php +++ b/tests/phpunit/includes/logging/PageLangLogFormatterTest.php @@ -5,7 +5,7 @@ */ class PageLangLogFormatterTest extends LogFormatterTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); // Disable cldr extension diff --git a/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php b/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php index 32a6b6ac0a7..f9e89d81c40 100644 --- a/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php +++ b/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php @@ -5,7 +5,7 @@ */ class BitmapMetadataHandlerTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( 'wgShowEXIF', false ); diff --git a/tests/phpunit/includes/media/BitmapScalingTest.php b/tests/phpunit/includes/media/BitmapScalingTest.php index fb96f7dbc1d..ebd4d10f676 100644 --- a/tests/phpunit/includes/media/BitmapScalingTest.php +++ b/tests/phpunit/includes/media/BitmapScalingTest.php @@ -5,7 +5,7 @@ */ class BitmapScalingTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/media/DjVuTest.php b/tests/phpunit/includes/media/DjVuTest.php index d9b5d824dd0..cbcb4f7a420 100644 --- a/tests/phpunit/includes/media/DjVuTest.php +++ b/tests/phpunit/includes/media/DjVuTest.php @@ -10,7 +10,7 @@ class DjVuTest extends MediaWikiMediaTestCase { */ protected $handler; - protected function setUp() { + protected function setUp() : void { parent::setUp(); // cli tool setup diff --git a/tests/phpunit/includes/media/ExifBitmapTest.php b/tests/phpunit/includes/media/ExifBitmapTest.php index eb02e7ed58f..920258a46e6 100644 --- a/tests/phpunit/includes/media/ExifBitmapTest.php +++ b/tests/phpunit/includes/media/ExifBitmapTest.php @@ -10,7 +10,7 @@ class ExifBitmapTest extends MediaWikiMediaTestCase { */ protected $handler; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->checkPHPExtension( 'exif' ); diff --git a/tests/phpunit/includes/media/ExifRotationTest.php b/tests/phpunit/includes/media/ExifRotationTest.php index e64d4afadc1..6994c78636e 100644 --- a/tests/phpunit/includes/media/ExifRotationTest.php +++ b/tests/phpunit/includes/media/ExifRotationTest.php @@ -12,7 +12,7 @@ class ExifRotationTest extends MediaWikiMediaTestCase { /** @var BitmapHandler */ private $handler; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->checkPHPExtension( 'exif' ); diff --git a/tests/phpunit/includes/media/ExifTest.php b/tests/phpunit/includes/media/ExifTest.php index 876e46172b4..5b1faec1a90 100644 --- a/tests/phpunit/includes/media/ExifTest.php +++ b/tests/phpunit/includes/media/ExifTest.php @@ -9,7 +9,7 @@ class ExifTest extends MediaWikiTestCase { /** @var string */ protected $mediaPath; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->checkPHPExtension( 'exif' ); diff --git a/tests/phpunit/includes/media/FormatMetadataTest.php b/tests/phpunit/includes/media/FormatMetadataTest.php index e6d2b277190..b156f0a551c 100644 --- a/tests/phpunit/includes/media/FormatMetadataTest.php +++ b/tests/phpunit/includes/media/FormatMetadataTest.php @@ -5,7 +5,7 @@ */ class FormatMetadataTest extends MediaWikiMediaTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->checkPHPExtension( 'exif' ); diff --git a/tests/phpunit/includes/media/GIFHandlerTest.php b/tests/phpunit/includes/media/GIFHandlerTest.php index 4dd7443e48b..f6e0b3b6e43 100644 --- a/tests/phpunit/includes/media/GIFHandlerTest.php +++ b/tests/phpunit/includes/media/GIFHandlerTest.php @@ -8,7 +8,7 @@ class GIFHandlerTest extends MediaWikiMediaTestCase { /** @var GIFHandler */ protected $handler; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->handler = new GIFHandler(); diff --git a/tests/phpunit/includes/media/JpegMetadataExtractorTest.php b/tests/phpunit/includes/media/JpegMetadataExtractorTest.php index 6b6ece2f87e..3f6684e8b18 100644 --- a/tests/phpunit/includes/media/JpegMetadataExtractorTest.php +++ b/tests/phpunit/includes/media/JpegMetadataExtractorTest.php @@ -13,7 +13,7 @@ class JpegMetadataExtractorTest extends MediaWikiIntegrationTestCase { protected $filePath; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->filePath = __DIR__ . '/../../data/media/'; diff --git a/tests/phpunit/includes/media/JpegPixelFormatTest.php b/tests/phpunit/includes/media/JpegPixelFormatTest.php index 8d0ddf8df47..7b3fda4963e 100644 --- a/tests/phpunit/includes/media/JpegPixelFormatTest.php +++ b/tests/phpunit/includes/media/JpegPixelFormatTest.php @@ -10,7 +10,7 @@ use MediaWiki\Shell\Shell; */ class JpegPixelFormatTest extends MediaWikiMediaTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); } diff --git a/tests/phpunit/includes/media/JpegTest.php b/tests/phpunit/includes/media/JpegTest.php index 13de7ff943f..98e0f3ef029 100644 --- a/tests/phpunit/includes/media/JpegTest.php +++ b/tests/phpunit/includes/media/JpegTest.php @@ -6,7 +6,7 @@ */ class JpegTest extends MediaWikiMediaTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->checkPHPExtension( 'exif' ); diff --git a/tests/phpunit/includes/media/MediaWikiMediaTestCase.php b/tests/phpunit/includes/media/MediaWikiMediaTestCase.php index 2e9acfade47..7958d791fe0 100644 --- a/tests/phpunit/includes/media/MediaWikiMediaTestCase.php +++ b/tests/phpunit/includes/media/MediaWikiMediaTestCase.php @@ -11,7 +11,7 @@ abstract class MediaWikiMediaTestCase extends MediaWikiTestCase { /** @var string */ protected $filePath; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->filePath = $this->getFilePath(); diff --git a/tests/phpunit/includes/media/PNGHandlerTest.php b/tests/phpunit/includes/media/PNGHandlerTest.php index 5a66586e255..2cc61b76770 100644 --- a/tests/phpunit/includes/media/PNGHandlerTest.php +++ b/tests/phpunit/includes/media/PNGHandlerTest.php @@ -8,7 +8,7 @@ class PNGHandlerTest extends MediaWikiMediaTestCase { /** @var PNGHandler */ protected $handler; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->handler = new PNGHandler(); } diff --git a/tests/phpunit/includes/media/PNGMetadataExtractorTest.php b/tests/phpunit/includes/media/PNGMetadataExtractorTest.php index 4d7ff48bbc9..afce4ed09b2 100644 --- a/tests/phpunit/includes/media/PNGMetadataExtractorTest.php +++ b/tests/phpunit/includes/media/PNGMetadataExtractorTest.php @@ -6,7 +6,7 @@ */ class PNGMetadataExtractorTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->filePath = __DIR__ . '/../../data/media/'; } diff --git a/tests/phpunit/includes/media/TiffTest.php b/tests/phpunit/includes/media/TiffTest.php index 8a69ec5b3aa..470d048ad63 100644 --- a/tests/phpunit/includes/media/TiffTest.php +++ b/tests/phpunit/includes/media/TiffTest.php @@ -10,7 +10,7 @@ class TiffTest extends MediaWikiTestCase { /** @var string */ protected $filePath; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->checkPHPExtension( 'exif' ); diff --git a/tests/phpunit/includes/media/WebPHandlerTest.php b/tests/phpunit/includes/media/WebPHandlerTest.php index ac0ad98eddf..e3881ab9b82 100644 --- a/tests/phpunit/includes/media/WebPHandlerTest.php +++ b/tests/phpunit/includes/media/WebPHandlerTest.php @@ -4,13 +4,13 @@ * @covers WebPHandler */ class WebPHandlerTest extends MediaWikiTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); // Allocated file for testing $this->tempFileName = tempnam( wfTempDir(), 'WEBP' ); } - public function tearDown() { + public function tearDown() : void { parent::tearDown(); unlink( $this->tempFileName ); } diff --git a/tests/phpunit/includes/media/XCFHandlerTest.php b/tests/phpunit/includes/media/XCFHandlerTest.php index b75335d6c0f..40e78795b6e 100644 --- a/tests/phpunit/includes/media/XCFHandlerTest.php +++ b/tests/phpunit/includes/media/XCFHandlerTest.php @@ -8,7 +8,7 @@ class XCFHandlerTest extends MediaWikiMediaTestCase { /** @var XCFHandler */ protected $handler; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->handler = new XCFHandler(); } diff --git a/tests/phpunit/includes/objectcache/ObjectCacheTest.php b/tests/phpunit/includes/objectcache/ObjectCacheTest.php index 7f52ca6039b..9440cdf3f92 100644 --- a/tests/phpunit/includes/objectcache/ObjectCacheTest.php +++ b/tests/phpunit/includes/objectcache/ObjectCacheTest.php @@ -2,7 +2,7 @@ class ObjectCacheTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { // Parent calls ObjectCache::clear() among other things parent::setUp(); diff --git a/tests/phpunit/includes/page/ArticleViewTest.php b/tests/phpunit/includes/page/ArticleViewTest.php index 96191ba5c2e..dd61661389c 100644 --- a/tests/phpunit/includes/page/ArticleViewTest.php +++ b/tests/phpunit/includes/page/ArticleViewTest.php @@ -11,7 +11,7 @@ use PHPUnit\Framework\MockObject\MockObject; */ class ArticleViewTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setUserLang( 'qqx' ); diff --git a/tests/phpunit/includes/page/ImagePage404Test.php b/tests/phpunit/includes/page/ImagePage404Test.php index dccc2ebc5d8..99cd1455fe3 100644 --- a/tests/phpunit/includes/page/ImagePage404Test.php +++ b/tests/phpunit/includes/page/ImagePage404Test.php @@ -8,7 +8,7 @@ class ImagePage404Test extends MediaWikiMediaTestCase { return parent::getRepoOptions() + [ 'transformVia404' => true ]; } - public function setUp() { + public function setUp() : void { $this->setMwGlobals( 'wgImageLimits', [ [ 320, 240 ], [ 640, 480 ], diff --git a/tests/phpunit/includes/page/ImagePageTest.php b/tests/phpunit/includes/page/ImagePageTest.php index 7e43ce4e65c..a741c0090b8 100644 --- a/tests/phpunit/includes/page/ImagePageTest.php +++ b/tests/phpunit/includes/page/ImagePageTest.php @@ -4,7 +4,7 @@ use Wikimedia\TestingAccessWrapper; class ImagePageTest extends MediaWikiMediaTestCase { - public function setUp() { + public function setUp() : void { $this->setMwGlobals( 'wgImageLimits', [ [ 320, 240 ], [ 640, 480 ], diff --git a/tests/phpunit/includes/page/PageArchiveTestBase.php b/tests/phpunit/includes/page/PageArchiveTestBase.php index b380c7e1a5a..3d4d2a9946e 100644 --- a/tests/phpunit/includes/page/PageArchiveTestBase.php +++ b/tests/phpunit/includes/page/PageArchiveTestBase.php @@ -78,7 +78,7 @@ abstract class PageArchiveTestBase extends MediaWikiTestCase { return true; } - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->tablesUsed += $this->getMcrTablesToReset(); diff --git a/tests/phpunit/includes/page/WikiPageDbTestBase.php b/tests/phpunit/includes/page/WikiPageDbTestBase.php index f0d895ee9e7..0ed4f89d6b9 100644 --- a/tests/phpunit/includes/page/WikiPageDbTestBase.php +++ b/tests/phpunit/includes/page/WikiPageDbTestBase.php @@ -54,7 +54,7 @@ abstract class WikiPageDbTestBase extends MediaWikiLangTestCase { */ abstract protected function getMcrTablesToReset(); - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->tablesUsed += $this->getMcrTablesToReset(); @@ -67,7 +67,7 @@ abstract class WikiPageDbTestBase extends MediaWikiLangTestCase { $this->pagesToDelete = []; } - protected function tearDown() { + protected function tearDown() : void { foreach ( $this->pagesToDelete as $p ) { /* @var WikiPage $p */ diff --git a/tests/phpunit/includes/page/WikiPageMcrDbTest.php b/tests/phpunit/includes/page/WikiPageMcrDbTest.php index fa98b52bcf8..ab5f9b1bafb 100644 --- a/tests/phpunit/includes/page/WikiPageMcrDbTest.php +++ b/tests/phpunit/includes/page/WikiPageMcrDbTest.php @@ -17,7 +17,7 @@ class WikiPageMcrDbTest extends WikiPageDbTestBase { use McrSchemaOverride; - public function setUp() { + public function setUp() : void { parent::setUp(); } diff --git a/tests/phpunit/includes/parser/MagicVariableTest.php b/tests/phpunit/includes/parser/MagicVariableTest.php index c5ee3d0e408..9a74d0e12f9 100644 --- a/tests/phpunit/includes/parser/MagicVariableTest.php +++ b/tests/phpunit/includes/parser/MagicVariableTest.php @@ -39,7 +39,7 @@ class MagicVariableTest extends MediaWikiTestCase { ]; /** setup a basic parser object */ - protected function setUp() { + protected function setUp() : void { parent::setUp(); $contLang = MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( 'en' ); diff --git a/tests/phpunit/includes/parser/ParserOptionsTest.php b/tests/phpunit/includes/parser/ParserOptionsTest.php index ec25697bec7..78199ddc1f9 100644 --- a/tests/phpunit/includes/parser/ParserOptionsTest.php +++ b/tests/phpunit/includes/parser/ParserOptionsTest.php @@ -26,7 +26,7 @@ class ParserOptionsTest extends MediaWikiTestCase { ]; } - protected function setUp() { + protected function setUp() : void { parent::setUp(); self::clearCache(); @@ -39,7 +39,7 @@ class ParserOptionsTest extends MediaWikiTestCase { $this->setTemporaryHook( 'PageRenderingHash', null ); } - protected function tearDown() { + protected function tearDown() : void { self::clearCache(); parent::tearDown(); } diff --git a/tests/phpunit/includes/parser/ParserOutputTest.php b/tests/phpunit/includes/parser/ParserOutputTest.php index b823e7003a1..e0aee15c1d6 100644 --- a/tests/phpunit/includes/parser/ParserOutputTest.php +++ b/tests/phpunit/includes/parser/ParserOutputTest.php @@ -33,7 +33,7 @@ class ParserOutputTest extends MediaWikiLangTestCase { ]; } - public function tearDown() { + public function tearDown() : void { MWTimestamp::setFakeTime( false ); parent::tearDown(); diff --git a/tests/phpunit/includes/parser/ParserPreloadTest.php b/tests/phpunit/includes/parser/ParserPreloadTest.php index 560b921a8dd..a09c9415c13 100644 --- a/tests/phpunit/includes/parser/ParserPreloadTest.php +++ b/tests/phpunit/includes/parser/ParserPreloadTest.php @@ -44,7 +44,7 @@ class ParserPreloadTest extends MediaWikiTestCase { */ private $title; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->testParserOptions = ParserOptions::newFromUserAndLang( new User, MediaWikiServices::getInstance()->getContentLanguage() ); @@ -56,7 +56,7 @@ class ParserPreloadTest extends MediaWikiTestCase { $this->title = Title::newFromText( 'Preload Test' ); } - protected function tearDown() { + protected function tearDown() : void { parent::tearDown(); unset( $this->testParser ); diff --git a/tests/phpunit/includes/parser/PreprocessorTest.php b/tests/phpunit/includes/parser/PreprocessorTest.php index d44123ee2c1..0cbe8205500 100644 --- a/tests/phpunit/includes/parser/PreprocessorTest.php +++ b/tests/phpunit/includes/parser/PreprocessorTest.php @@ -43,7 +43,7 @@ class PreprocessorTest extends MediaWikiTestCase { Preprocessor_Hash::class ]; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->mOptions = ParserOptions::newFromUserAndLang( new User, MediaWikiServices::getInstance()->getContentLanguage() ); diff --git a/tests/phpunit/includes/parser/SanitizerTest.php b/tests/phpunit/includes/parser/SanitizerTest.php index 4841b56a5ef..005d9011b91 100644 --- a/tests/phpunit/includes/parser/SanitizerTest.php +++ b/tests/phpunit/includes/parser/SanitizerTest.php @@ -7,7 +7,7 @@ use Wikimedia\TestingAccessWrapper; */ class SanitizerTest extends MediaWikiTestCase { - protected function tearDown() { + protected function tearDown() : void { MWTidy::destroySingleton(); parent::tearDown(); } diff --git a/tests/phpunit/includes/parser/StripStateTest.php b/tests/phpunit/includes/parser/StripStateTest.php index 0f4f6e0faed..a0c502b3bc1 100644 --- a/tests/phpunit/includes/parser/StripStateTest.php +++ b/tests/phpunit/includes/parser/StripStateTest.php @@ -4,7 +4,7 @@ * @covers StripState */ class StripStateTest extends MediaWikiTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); $this->setContentLang( 'qqx' ); } diff --git a/tests/phpunit/includes/password/Argon2PasswordTest.php b/tests/phpunit/includes/password/Argon2PasswordTest.php index 6de56173a65..a49c5c533ae 100644 --- a/tests/phpunit/includes/password/Argon2PasswordTest.php +++ b/tests/phpunit/includes/password/Argon2PasswordTest.php @@ -10,7 +10,7 @@ */ class Argon2PasswordTest extends PasswordTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); if ( !defined( 'PASSWORD_ARGON2I' ) ) { $this->markTestSkipped( 'Argon2 support not found' ); diff --git a/tests/phpunit/includes/password/PasswordTestCase.php b/tests/phpunit/includes/password/PasswordTestCase.php index 4557aceeec6..7b440bf5074 100644 --- a/tests/phpunit/includes/password/PasswordTestCase.php +++ b/tests/phpunit/includes/password/PasswordTestCase.php @@ -29,7 +29,7 @@ abstract class PasswordTestCase extends MediaWikiTestCase { */ protected $passwordFactory; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->passwordFactory = new PasswordFactory(); diff --git a/tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php b/tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php index 1e063dd9eff..c87f65cba2b 100644 --- a/tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php +++ b/tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php @@ -37,7 +37,7 @@ class DefaultPreferencesFactoryTest extends \MediaWikiTestCase { /** @var Config */ protected $config; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->context = new RequestContext(); $this->context->setTitle( Title::newFromText( self::class ) ); diff --git a/tests/phpunit/includes/rcfeed/RCFeedIntegrationTest.php b/tests/phpunit/includes/rcfeed/RCFeedIntegrationTest.php index 59fe4012b61..401f687ee56 100644 --- a/tests/phpunit/includes/rcfeed/RCFeedIntegrationTest.php +++ b/tests/phpunit/includes/rcfeed/RCFeedIntegrationTest.php @@ -10,7 +10,7 @@ * @covers RCFeed */ class RCFeedIntegrationTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ 'wgCanonicalServer' => 'https://example.org', diff --git a/tests/phpunit/includes/registration/ExtensionRegistryTest.php b/tests/phpunit/includes/registration/ExtensionRegistryTest.php index fbd1bcb7d23..2f3462c0780 100644 --- a/tests/phpunit/includes/registration/ExtensionRegistryTest.php +++ b/tests/phpunit/includes/registration/ExtensionRegistryTest.php @@ -9,7 +9,7 @@ class ExtensionRegistryTest extends MediaWikiTestCase { private $dataDir; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->dataDir = __DIR__ . '/../../data/registration'; } diff --git a/tests/phpunit/includes/resourceloader/MessageBlobStoreTest.php b/tests/phpunit/includes/resourceloader/MessageBlobStoreTest.php index d5760ed4b26..98cac4dd344 100644 --- a/tests/phpunit/includes/resourceloader/MessageBlobStoreTest.php +++ b/tests/phpunit/includes/resourceloader/MessageBlobStoreTest.php @@ -12,7 +12,7 @@ class MessageBlobStoreTest extends PHPUnit\Framework\TestCase { const NAME = 'test.blobstore'; - protected function setUp() { + protected function setUp() : void { parent::setUp(); // MediaWiki's test wrapper sets $wgMainWANCache to CACHE_NONE. // Use HashBagOStuff here so that we can observe caching. diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php index 5e2cf8229ce..2b3ed10cca2 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php @@ -5,7 +5,7 @@ */ class ResourceLoaderFileModuleTest extends ResourceLoaderTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $skinFactory = new SkinFactory(); diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderTest.php index 2cc72571cab..47e3858240d 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderTest.php @@ -5,7 +5,7 @@ use MediaWiki\MediaWikiServices; class ResourceLoaderTest extends ResourceLoaderTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php index 089431e9527..f790710f607 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php @@ -445,7 +445,7 @@ class ResourceLoaderWikiModuleTest extends ResourceLoaderTestCase { ); } - public function tearDown() { + public function tearDown() : void { Title::clearCaches(); parent::tearDown(); } diff --git a/tests/phpunit/includes/search/SearchEnginePrefixTest.php b/tests/phpunit/includes/search/SearchEnginePrefixTest.php index ed750766d41..e76b1dd37e0 100644 --- a/tests/phpunit/includes/search/SearchEnginePrefixTest.php +++ b/tests/phpunit/includes/search/SearchEnginePrefixTest.php @@ -50,7 +50,7 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase { $this->insertPage( 'External' ); } - protected function setUp() { + protected function setUp() : void { parent::setUp(); if ( !$this->isWikitextNS( NS_MAIN ) ) { @@ -70,7 +70,7 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase { TestingAccessWrapper::newFromClass( Hooks::class )->handlers = []; } - public function tearDown() { + public function tearDown() : void { parent::tearDown(); TestingAccessWrapper::newFromClass( Hooks::class )->handlers = $this->originalHandlers; diff --git a/tests/phpunit/includes/search/SearchEngineTest.php b/tests/phpunit/includes/search/SearchEngineTest.php index d66e480c054..6a84584daee 100644 --- a/tests/phpunit/includes/search/SearchEngineTest.php +++ b/tests/phpunit/includes/search/SearchEngineTest.php @@ -20,7 +20,7 @@ class SearchEngineTest extends MediaWikiLangTestCase { * Checks for database type & version. * Will skip current test if DB does not support search. */ - protected function setUp() { + protected function setUp() : void { parent::setUp(); // Search tests require MySQL or SQLite with FTS @@ -45,7 +45,7 @@ class SearchEngineTest extends MediaWikiLangTestCase { $this->search = new $searchType( $lb ); } - protected function tearDown() { + protected function tearDown() : void { unset( $this->search ); parent::tearDown(); diff --git a/tests/phpunit/includes/search/SearchNearMatcherTest.php b/tests/phpunit/includes/search/SearchNearMatcherTest.php index e3a7ec9a04e..14f2a1f1b5c 100644 --- a/tests/phpunit/includes/search/SearchNearMatcherTest.php +++ b/tests/phpunit/includes/search/SearchNearMatcherTest.php @@ -30,7 +30,7 @@ class SearchNearMatcherTest extends \PHPUnit\Framework\TestCase { $this->assertEquals( $expected, $title === null ? null : (string)$title ); } - public function tearDown() { + public function tearDown() : void { Title::clearCaches(); parent::tearDown(); } diff --git a/tests/phpunit/includes/session/BotPasswordSessionProviderTest.php b/tests/phpunit/includes/session/BotPasswordSessionProviderTest.php index 22980562650..17863f816eb 100644 --- a/tests/phpunit/includes/session/BotPasswordSessionProviderTest.php +++ b/tests/phpunit/includes/session/BotPasswordSessionProviderTest.php @@ -50,7 +50,7 @@ class BotPasswordSessionProviderTest extends MediaWikiTestCase { return $manager->getProvider( BotPasswordSessionProvider::class ); } - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/specialpage/AbstractChangesListSpecialPageTestCase.php b/tests/phpunit/includes/specialpage/AbstractChangesListSpecialPageTestCase.php index 92d986d70ac..d4a2baf548c 100644 --- a/tests/phpunit/includes/specialpage/AbstractChangesListSpecialPageTestCase.php +++ b/tests/phpunit/includes/specialpage/AbstractChangesListSpecialPageTestCase.php @@ -15,7 +15,7 @@ abstract class AbstractChangesListSpecialPageTestCase extends MediaWikiTestCase protected $oldPatrollersGroup; - protected function setUp() { + protected function setUp() : void { global $wgGroupPermissions; parent::setUp(); @@ -43,7 +43,7 @@ abstract class AbstractChangesListSpecialPageTestCase extends MediaWikiTestCase abstract protected function getPage(); - protected function tearDown() { + protected function tearDown() : void { global $wgGroupPermissions; parent::tearDown(); diff --git a/tests/phpunit/includes/specialpage/SpecialPageTest.php b/tests/phpunit/includes/specialpage/SpecialPageTest.php index fe922a04701..f9145a79691 100644 --- a/tests/phpunit/includes/specialpage/SpecialPageTest.php +++ b/tests/phpunit/includes/specialpage/SpecialPageTest.php @@ -12,7 +12,7 @@ use PHPUnit\Framework\Error\Notice; */ class SpecialPageTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setContentLang( 'en' ); diff --git a/tests/phpunit/includes/specials/ContribsPagerTest.php b/tests/phpunit/includes/specials/ContribsPagerTest.php index 1993250cfd6..78d3fdc37b4 100644 --- a/tests/phpunit/includes/specials/ContribsPagerTest.php +++ b/tests/phpunit/includes/specials/ContribsPagerTest.php @@ -13,7 +13,7 @@ class ContribsPagerTest extends MediaWikiTestCase { /** @var LinkRenderer */ private $linkRenderer; - public function setUp() { + public function setUp() : void { $this->linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); $context = new RequestContext(); $this->pager = new ContribsPager( $context, [ diff --git a/tests/phpunit/includes/specials/SpecialBlankPageTest.php b/tests/phpunit/includes/specials/SpecialBlankPageTest.php index 5435afa36e1..2772d20d693 100644 --- a/tests/phpunit/includes/specials/SpecialBlankPageTest.php +++ b/tests/phpunit/includes/specials/SpecialBlankPageTest.php @@ -8,7 +8,7 @@ */ class SpecialBlankPageTest extends SpecialPageTestBase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setUserLang( 'qqx' ); } diff --git a/tests/phpunit/includes/specials/SpecialBlockTest.php b/tests/phpunit/includes/specials/SpecialBlockTest.php index fe333fee53e..c93e15c7a7f 100644 --- a/tests/phpunit/includes/specials/SpecialBlockTest.php +++ b/tests/phpunit/includes/specials/SpecialBlockTest.php @@ -20,7 +20,7 @@ class SpecialBlockTest extends SpecialPageTestBase { return new SpecialBlock(); } - public function tearDown() { + public function tearDown() : void { parent::tearDown(); $this->resetTables(); } diff --git a/tests/phpunit/includes/specials/SpecialMIMESearchTest.php b/tests/phpunit/includes/specials/SpecialMIMESearchTest.php index 499288e9f3c..13dadfee64b 100644 --- a/tests/phpunit/includes/specials/SpecialMIMESearchTest.php +++ b/tests/phpunit/includes/specials/SpecialMIMESearchTest.php @@ -9,7 +9,7 @@ class SpecialMIMESearchTest extends MediaWikiTestCase { /** @var SpecialMIMESearch */ private $page; - public function setUp() { + public function setUp() : void { $this->page = new SpecialMIMESearch; $context = new RequestContext(); $context->setTitle( Title::makeTitle( NS_SPECIAL, 'MIMESearch' ) ); diff --git a/tests/phpunit/includes/specials/SpecialMuteTest.php b/tests/phpunit/includes/specials/SpecialMuteTest.php index d2b83e1798d..123c7d23f59 100644 --- a/tests/phpunit/includes/specials/SpecialMuteTest.php +++ b/tests/phpunit/includes/specials/SpecialMuteTest.php @@ -6,7 +6,7 @@ */ class SpecialMuteTest extends SpecialPageTestBase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/specials/SpecialPageDataTest.php b/tests/phpunit/includes/specials/SpecialPageDataTest.php index b11973c9cdb..8468b5b0457 100644 --- a/tests/phpunit/includes/specials/SpecialPageDataTest.php +++ b/tests/phpunit/includes/specials/SpecialPageDataTest.php @@ -9,7 +9,7 @@ */ class SpecialPageDataTest extends SpecialPageTestBase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setContentLang( 'qqx' ); diff --git a/tests/phpunit/includes/specials/SpecialPageTestBase.php b/tests/phpunit/includes/specials/SpecialPageTestBase.php index fc9e2f0d79e..c104e58e1a7 100644 --- a/tests/phpunit/includes/specials/SpecialPageTestBase.php +++ b/tests/phpunit/includes/specials/SpecialPageTestBase.php @@ -15,13 +15,13 @@ abstract class SpecialPageTestBase extends MediaWikiTestCase { private $obLevel; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->obLevel = ob_get_level(); } - protected function tearDown() { + protected function tearDown() : void { $obLevel = ob_get_level(); while ( ob_get_level() > $this->obLevel ) { diff --git a/tests/phpunit/includes/specials/SpecialWatchlistTest.php b/tests/phpunit/includes/specials/SpecialWatchlistTest.php index c9c06db094a..a7b00bb2b1f 100644 --- a/tests/phpunit/includes/specials/SpecialWatchlistTest.php +++ b/tests/phpunit/includes/specials/SpecialWatchlistTest.php @@ -10,7 +10,7 @@ use Wikimedia\TestingAccessWrapper; * @covers SpecialWatchlist */ class SpecialWatchlistTest extends SpecialPageTestBase { - public function setUp() { + public function setUp() : void { parent::setUp(); $this->tablesUsed = [ 'watchlist' ]; $this->setTemporaryHook( diff --git a/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php b/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php index a0291509cb7..92fe7214677 100644 --- a/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php +++ b/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php @@ -17,7 +17,7 @@ class BlockListPagerTest extends MediaWikiTestCase { */ private $linkRenderer; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); diff --git a/tests/phpunit/includes/title/MediaWikiTitleCodecTest.php b/tests/phpunit/includes/title/MediaWikiTitleCodecTest.php index fc83a70d76d..79bc32942f0 100644 --- a/tests/phpunit/includes/title/MediaWikiTitleCodecTest.php +++ b/tests/phpunit/includes/title/MediaWikiTitleCodecTest.php @@ -31,7 +31,7 @@ use MediaWiki\MediaWikiServices; */ class MediaWikiTitleCodecTest extends MediaWikiTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/title/NaiveImportTitleFactoryTest.php b/tests/phpunit/includes/title/NaiveImportTitleFactoryTest.php index 71e52e8fedb..7a82a429a87 100644 --- a/tests/phpunit/includes/title/NaiveImportTitleFactoryTest.php +++ b/tests/phpunit/includes/title/NaiveImportTitleFactoryTest.php @@ -26,7 +26,7 @@ */ class NaiveImportTitleFactoryTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setContentLang( 'en' ); diff --git a/tests/phpunit/includes/title/NamespaceImportTitleFactoryTest.php b/tests/phpunit/includes/title/NamespaceImportTitleFactoryTest.php index ae8727668e5..3ebb4bcef0a 100644 --- a/tests/phpunit/includes/title/NamespaceImportTitleFactoryTest.php +++ b/tests/phpunit/includes/title/NamespaceImportTitleFactoryTest.php @@ -26,7 +26,7 @@ */ class NamespaceImportTitleFactoryTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setContentLang( 'en' ); diff --git a/tests/phpunit/includes/title/NamespaceInfoTest.php b/tests/phpunit/includes/title/NamespaceInfoTest.php index d8df252bd40..cfbbc68d17a 100644 --- a/tests/phpunit/includes/title/NamespaceInfoTest.php +++ b/tests/phpunit/includes/title/NamespaceInfoTest.php @@ -17,7 +17,7 @@ class NamespaceInfoTest extends MediaWikiTestCase { */ private $scopedCallback; - public function setUp() { + public function setUp() : void { parent::setUp(); // Boo, there's still some global state in the class :( @@ -30,7 +30,7 @@ class NamespaceInfoTest extends MediaWikiTestCase { ExtensionRegistry::getInstance()->setAttributeForTest( 'ExtensionNamespaces', [] ); } - public function tearDown() { + public function tearDown() : void { $this->scopedCallback = null; parent::tearDown(); diff --git a/tests/phpunit/includes/title/SubpageImportTitleFactoryTest.php b/tests/phpunit/includes/title/SubpageImportTitleFactoryTest.php index ff16f790149..fcb7e1482ea 100644 --- a/tests/phpunit/includes/title/SubpageImportTitleFactoryTest.php +++ b/tests/phpunit/includes/title/SubpageImportTitleFactoryTest.php @@ -26,7 +26,7 @@ */ class SubpageImportTitleFactoryTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setContentLang( 'en' ); diff --git a/tests/phpunit/includes/upload/UploadBaseTest.php b/tests/phpunit/includes/upload/UploadBaseTest.php index cafc846e9af..bcc6452c4ae 100644 --- a/tests/phpunit/includes/upload/UploadBaseTest.php +++ b/tests/phpunit/includes/upload/UploadBaseTest.php @@ -8,7 +8,7 @@ class UploadBaseTest extends MediaWikiTestCase { /** @var UploadTestHandler */ protected $upload; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->upload = new UploadTestHandler; diff --git a/tests/phpunit/includes/upload/UploadFromUrlTest.php b/tests/phpunit/includes/upload/UploadFromUrlTest.php index a69a137b72b..36ef8210944 100644 --- a/tests/phpunit/includes/upload/UploadFromUrlTest.php +++ b/tests/phpunit/includes/upload/UploadFromUrlTest.php @@ -8,7 +8,7 @@ * @covers UploadFromUrl */ class UploadFromUrlTest extends ApiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/upload/UploadStashTest.php b/tests/phpunit/includes/upload/UploadStashTest.php index 26088a3657c..0291c650695 100644 --- a/tests/phpunit/includes/upload/UploadStashTest.php +++ b/tests/phpunit/includes/upload/UploadStashTest.php @@ -16,7 +16,7 @@ class UploadStashTest extends MediaWikiTestCase { */ private $tmpFile; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->tmpFile = $this->getNewTempFile(); diff --git a/tests/phpunit/includes/user/BotPasswordTest.php b/tests/phpunit/includes/user/BotPasswordTest.php index 4ef8ea90a1c..b2631b50bbb 100644 --- a/tests/phpunit/includes/user/BotPasswordTest.php +++ b/tests/phpunit/includes/user/BotPasswordTest.php @@ -17,7 +17,7 @@ class BotPasswordTest extends MediaWikiTestCase { /** @var string */ private $testUserName; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/user/LocalIdLookupTest.php b/tests/phpunit/includes/user/LocalIdLookupTest.php index 0e4674455c4..9cfcedacf3c 100644 --- a/tests/phpunit/includes/user/LocalIdLookupTest.php +++ b/tests/phpunit/includes/user/LocalIdLookupTest.php @@ -10,7 +10,7 @@ use MediaWiki\MediaWikiServices; class LocalIdLookupTest extends MediaWikiTestCase { private $localUsers = []; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setGroupPermissions( 'local-id-lookup-test', 'hideuser', true ); diff --git a/tests/phpunit/includes/user/UserGroupMembershipTest.php b/tests/phpunit/includes/user/UserGroupMembershipTest.php index 6f575789f51..dfc3e131368 100644 --- a/tests/phpunit/includes/user/UserGroupMembershipTest.php +++ b/tests/phpunit/includes/user/UserGroupMembershipTest.php @@ -24,7 +24,7 @@ class UserGroupMembershipTest extends MediaWikiTestCase { */ protected $expiryTime; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/user/UserTest.php b/tests/phpunit/includes/user/UserTest.php index 424e2792dae..4d551630abd 100644 --- a/tests/phpunit/includes/user/UserTest.php +++ b/tests/phpunit/includes/user/UserTest.php @@ -25,7 +25,7 @@ class UserTest extends MediaWikiTestCase { */ protected $user; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( [ diff --git a/tests/phpunit/includes/utils/MWCryptHKDFTest.php b/tests/phpunit/includes/utils/MWCryptHKDFTest.php index 05a33c5af6f..ff9737014ed 100644 --- a/tests/phpunit/includes/utils/MWCryptHKDFTest.php +++ b/tests/phpunit/includes/utils/MWCryptHKDFTest.php @@ -6,7 +6,7 @@ */ class MWCryptHKDFTest extends MediaWikiTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setMwGlobals( 'wgSecretKey', '5bf1945342e67799cb50704a7fa19ac6' ); diff --git a/tests/phpunit/includes/utils/MWGrantsTest.php b/tests/phpunit/includes/utils/MWGrantsTest.php index eae9c15d824..53977b45926 100644 --- a/tests/phpunit/includes/utils/MWGrantsTest.php +++ b/tests/phpunit/includes/utils/MWGrantsTest.php @@ -1,7 +1,7 @@ setMwGlobals( [ diff --git a/tests/phpunit/includes/utils/UIDGeneratorTest.php b/tests/phpunit/includes/utils/UIDGeneratorTest.php index e600021e975..82341d9b370 100644 --- a/tests/phpunit/includes/utils/UIDGeneratorTest.php +++ b/tests/phpunit/includes/utils/UIDGeneratorTest.php @@ -4,7 +4,7 @@ class UIDGeneratorTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; - protected function tearDown() { + protected function tearDown() : void { // T46850 UIDGenerator::unitTestTearDown(); parent::tearDown(); diff --git a/tests/phpunit/includes/utils/ZipDirectoryReaderTest.php b/tests/phpunit/includes/utils/ZipDirectoryReaderTest.php index 631e7d45546..5f235afd674 100644 --- a/tests/phpunit/includes/utils/ZipDirectoryReaderTest.php +++ b/tests/phpunit/includes/utils/ZipDirectoryReaderTest.php @@ -8,7 +8,7 @@ class ZipDirectoryReaderTest extends MediaWikiIntegrationTestCase { protected $zipDir; protected $entries; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->zipDir = __DIR__ . '/../../data/zip'; } diff --git a/tests/phpunit/includes/watcheditem/WatchedItemStoreIntegrationTest.php b/tests/phpunit/includes/watcheditem/WatchedItemStoreIntegrationTest.php index 20dbedb50bf..058fd5dbf7b 100644 --- a/tests/phpunit/includes/watcheditem/WatchedItemStoreIntegrationTest.php +++ b/tests/phpunit/includes/watcheditem/WatchedItemStoreIntegrationTest.php @@ -12,7 +12,7 @@ use Wikimedia\TestingAccessWrapper; */ class WatchedItemStoreIntegrationTest extends MediaWikiTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); self::$users['WatchedItemStoreIntegrationTestUser'] = new TestUser( 'WatchedItemStoreIntegrationTestUser' ); diff --git a/tests/phpunit/integration/includes/db/DatabaseSqliteTest.php b/tests/phpunit/integration/includes/db/DatabaseSqliteTest.php index 5d09e714500..f770508a90c 100644 --- a/tests/phpunit/integration/includes/db/DatabaseSqliteTest.php +++ b/tests/phpunit/integration/includes/db/DatabaseSqliteTest.php @@ -17,7 +17,7 @@ class DatabaseSqliteTest extends \MediaWikiIntegrationTestCase { /** @var DatabaseSqlite */ protected $db; - protected function setUp() { + protected function setUp() : void { parent::setUp(); if ( !Sqlite::isPresent() ) { diff --git a/tests/phpunit/languages/LanguageClassesTestCase.php b/tests/phpunit/languages/LanguageClassesTestCase.php index 99cd708bd6d..ad9626d939b 100644 --- a/tests/phpunit/languages/LanguageClassesTestCase.php +++ b/tests/phpunit/languages/LanguageClassesTestCase.php @@ -48,7 +48,7 @@ abstract class LanguageClassesTestCase extends MediaWikiTestCase { /** * Create a new language object before each test. */ - protected function setUp() { + protected function setUp() : void { parent::setUp(); $found = preg_match( '/Language(.+)Test/', static::class, $m ); if ( $found ) { @@ -71,7 +71,7 @@ abstract class LanguageClassesTestCase extends MediaWikiTestCase { * Delete the internal language object so each test start * out with a fresh language instance. */ - protected function tearDown() { + protected function tearDown() : void { unset( $this->languageObject ); parent::tearDown(); } diff --git a/tests/phpunit/languages/LanguageConverterTest.php b/tests/phpunit/languages/LanguageConverterTest.php index 85cdd33830e..dca42d72e1f 100644 --- a/tests/phpunit/languages/LanguageConverterTest.php +++ b/tests/phpunit/languages/LanguageConverterTest.php @@ -6,7 +6,7 @@ class LanguageConverterTest extends MediaWikiLangTestCase { /** @var TestConverter */ protected $lc; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->setContentLang( 'tg' ); @@ -32,7 +32,7 @@ class LanguageConverterTest extends MediaWikiLangTestCase { ); } - protected function tearDown() { + protected function tearDown() : void { unset( $this->lc ); unset( $this->lang ); diff --git a/tests/phpunit/languages/LanguageIntegrationTest.php b/tests/phpunit/languages/LanguageIntegrationTest.php index 534d8858c9a..16c57580f41 100644 --- a/tests/phpunit/languages/LanguageIntegrationTest.php +++ b/tests/phpunit/languages/LanguageIntegrationTest.php @@ -20,7 +20,7 @@ class LanguageIntegrationTest extends LanguageClassesTestCase { ); } - public function setUp() { + public function setUp() : void { global $wgHooks; parent::setUp(); diff --git a/tests/phpunit/maintenance/DumpTestCase.php b/tests/phpunit/maintenance/DumpTestCase.php index be054e016fa..100e4e76810 100644 --- a/tests/phpunit/maintenance/DumpTestCase.php +++ b/tests/phpunit/maintenance/DumpTestCase.php @@ -142,7 +142,7 @@ abstract class DumpTestCase extends MediaWikiLangTestCase { * * Clears $wgUser, and reports errors from addDBData to PHPUnit */ - protected function setUp() { + protected function setUp() : void { parent::setUp(); // Check if any Exception is stored for rethrowing from addDBData diff --git a/tests/phpunit/maintenance/MaintenanceBaseTestCase.php b/tests/phpunit/maintenance/MaintenanceBaseTestCase.php index bdcf7e5fa73..07b84676e1a 100644 --- a/tests/phpunit/maintenance/MaintenanceBaseTestCase.php +++ b/tests/phpunit/maintenance/MaintenanceBaseTestCase.php @@ -15,7 +15,7 @@ abstract class MaintenanceBaseTestCase extends MediaWikiTestCase { */ protected $maintenance; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->maintenance = $this->createMaintenance(); @@ -25,7 +25,7 @@ abstract class MaintenanceBaseTestCase extends MediaWikiTestCase { * Do a little stream cleanup to prevent output in case the child class * hasn't tested the capture buffer. */ - protected function tearDown() { + protected function tearDown() : void { if ( $this->maintenance ) { $this->maintenance->cleanupChanneled(); } diff --git a/tests/phpunit/maintenance/backupPrefetchTest.php b/tests/phpunit/maintenance/backupPrefetchTest.php index 62e4c8a9ee4..ceae38c1ea9 100644 --- a/tests/phpunit/maintenance/backupPrefetchTest.php +++ b/tests/phpunit/maintenance/backupPrefetchTest.php @@ -18,7 +18,7 @@ class BaseDumpTest extends MediaWikiTestCase { */ private $dump = null; - protected function tearDown() { + protected function tearDown() : void { if ( $this->dump !== null ) { $this->dump->close(); } diff --git a/tests/phpunit/maintenance/backupTextPassTest.php b/tests/phpunit/maintenance/backupTextPassTest.php index 6b119b1709b..c7e13a9d46d 100644 --- a/tests/phpunit/maintenance/backupTextPassTest.php +++ b/tests/phpunit/maintenance/backupTextPassTest.php @@ -104,7 +104,7 @@ class TextPassDumperDatabaseTest extends DumpTestCase { } } - protected function setUp() { + protected function setUp() : void { parent::setUp(); // Since we will restrict dumping by page ranges (to allow diff --git a/tests/phpunit/maintenance/backup_PageTest.php b/tests/phpunit/maintenance/backup_PageTest.php index a14cf35fb8a..8cdebdd186d 100644 --- a/tests/phpunit/maintenance/backup_PageTest.php +++ b/tests/phpunit/maintenance/backup_PageTest.php @@ -150,7 +150,7 @@ class BackupDumperPageTest extends DumpTestCase { } } - protected function setUp() { + protected function setUp() : void { parent::setUp(); // Since we will restrict dumping by page ranges (to allow @@ -163,7 +163,7 @@ class BackupDumperPageTest extends DumpTestCase { "Page ids increasing without holes" ); } - public function tearDown() { + public function tearDown() : void { parent::tearDown(); if ( isset( $this->streamingLoadBalancer ) ) { diff --git a/tests/phpunit/maintenance/categoryChangesAsRdfTest.php b/tests/phpunit/maintenance/categoryChangesAsRdfTest.php index 8925b1f7867..394c16feb71 100644 --- a/tests/phpunit/maintenance/categoryChangesAsRdfTest.php +++ b/tests/phpunit/maintenance/categoryChangesAsRdfTest.php @@ -8,7 +8,7 @@ use Wikimedia\Rdbms\IDatabase; */ class CategoryChangesAsRdfTest extends MediaWikiLangTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); $this->setMwGlobals( [ 'wgServer' => 'http://acme.test', diff --git a/tests/phpunit/maintenance/deleteAutoPatrolLogsTest.php b/tests/phpunit/maintenance/deleteAutoPatrolLogsTest.php index cd0d7a52055..a599287a2cf 100644 --- a/tests/phpunit/maintenance/deleteAutoPatrolLogsTest.php +++ b/tests/phpunit/maintenance/deleteAutoPatrolLogsTest.php @@ -14,7 +14,7 @@ class DeleteAutoPatrolLogsTest extends MaintenanceBaseTestCase { return DeleteAutoPatrolLogs::class; } - public function setUp() { + public function setUp() : void { parent::setUp(); $this->tablesUsed = [ 'logging' ]; diff --git a/tests/phpunit/maintenance/fetchTextTest.php b/tests/phpunit/maintenance/fetchTextTest.php index 6e3899e4a4b..227213379e1 100644 --- a/tests/phpunit/maintenance/fetchTextTest.php +++ b/tests/phpunit/maintenance/fetchTextTest.php @@ -172,7 +172,7 @@ class FetchTextTest extends MediaWikiTestCase { } } - protected function setUp() { + protected function setUp() : void { parent::setUp(); // Check if any Exception is stored for rethrowing from addDBData diff --git a/tests/phpunit/skins/SideBarTest.php b/tests/phpunit/skins/SideBarTest.php index 5373ce328cb..cbca1418caf 100644 --- a/tests/phpunit/skins/SideBarTest.php +++ b/tests/phpunit/skins/SideBarTest.php @@ -39,7 +39,7 @@ class SideBarTest extends MediaWikiLangTestCase { } } - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->initMessagesHref(); $this->skin = new SkinTemplate(); diff --git a/tests/phpunit/structure/DatabaseIntegrationTest.php b/tests/phpunit/structure/DatabaseIntegrationTest.php index b0c1c8f1f5e..be65b05da0e 100644 --- a/tests/phpunit/structure/DatabaseIntegrationTest.php +++ b/tests/phpunit/structure/DatabaseIntegrationTest.php @@ -14,12 +14,12 @@ class DatabaseIntegrationTest extends MediaWikiTestCase { private $functionTest = false; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->db = wfGetDB( DB_MASTER ); } - protected function tearDown() { + protected function tearDown() : void { parent::tearDown(); if ( $this->functionTest ) { $this->dropFunctions(); diff --git a/tests/phpunit/structure/ExtensionJsonValidationTest.php b/tests/phpunit/structure/ExtensionJsonValidationTest.php index 5f76456bd38..7cf0a325285 100644 --- a/tests/phpunit/structure/ExtensionJsonValidationTest.php +++ b/tests/phpunit/structure/ExtensionJsonValidationTest.php @@ -29,7 +29,7 @@ class ExtensionJsonValidationTest extends PHPUnit\Framework\TestCase { */ protected $validator; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->validator = new ExtensionJsonValidator( [ $this, 'markTestSkipped' ] ); diff --git a/tests/phpunit/suites/ParserIntegrationTest.php b/tests/phpunit/suites/ParserIntegrationTest.php index 0f06d3979ab..e21a18308d8 100644 --- a/tests/phpunit/suites/ParserIntegrationTest.php +++ b/tests/phpunit/suites/ParserIntegrationTest.php @@ -54,11 +54,11 @@ class ParserIntegrationTest extends PHPUnit\Framework\TestCase { $this->assertEquals( $result->expected, $result->actual ); } - public function setUp() { + public function setUp() : void { $this->ptTeardownScope = $this->ptRunner->staticSetup(); } - public function tearDown() { + public function tearDown() : void { if ( $this->ptTeardownScope ) { ScopedCallback::consume( $this->ptTeardownScope ); } diff --git a/tests/phpunit/suites/ParserTestFileSuite.php b/tests/phpunit/suites/ParserTestFileSuite.php index 843718d046c..843a111147d 100644 --- a/tests/phpunit/suites/ParserTestFileSuite.php +++ b/tests/phpunit/suites/ParserTestFileSuite.php @@ -24,7 +24,7 @@ class ParserTestFileSuite extends TestSuite { } } - public function setUp() { + public function setUp() : void { if ( !$this->ptRunner->meetsRequirements( $this->ptFileInfo['requirements'] ) ) { $this->markTestSuiteSkipped( 'required extension not enabled' ); } else { diff --git a/tests/phpunit/suites/ParserTestTopLevelSuite.php b/tests/phpunit/suites/ParserTestTopLevelSuite.php index bec809fb6ef..28b2b143d3a 100644 --- a/tests/phpunit/suites/ParserTestTopLevelSuite.php +++ b/tests/phpunit/suites/ParserTestTopLevelSuite.php @@ -136,7 +136,7 @@ class ParserTestTopLevelSuite extends TestSuite { } } - public function setUp() { + public function setUp() : void { wfDebug( __METHOD__ ); $lb = MediaWikiServices::getInstance()->getDBLoadBalancer(); @@ -160,7 +160,7 @@ class ParserTestTopLevelSuite extends TestSuite { $this->ptTeardownScope = $teardown; } - public function tearDown() { + public function tearDown() : void { wfDebug( __METHOD__ ); if ( $this->ptTeardownScope ) { ScopedCallback::consume( $this->ptTeardownScope ); diff --git a/tests/phpunit/suites/UploadFromUrlTestSuite.php b/tests/phpunit/suites/UploadFromUrlTestSuite.php index 35fa6b7055a..c25cad60057 100644 --- a/tests/phpunit/suites/UploadFromUrlTestSuite.php +++ b/tests/phpunit/suites/UploadFromUrlTestSuite.php @@ -18,7 +18,7 @@ class UploadFromUrlTestSuite extends TestSuite { return true; } - protected function setUp() { + protected function setUp() : void { global $IP, $wgMemc, $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgParserCacheType, $wgNamespaceAliases, $wgNamespaceProtection; @@ -77,7 +77,7 @@ class UploadFromUrlTestSuite extends TestSuite { MediaWikiServices::getInstance()->resetServiceForTesting( 'FileBackendGroup' ); } - protected function tearDown() { + protected function tearDown() : void { foreach ( $this->savedGlobals as $var => $val ) { $GLOBALS[$var] = $val; } diff --git a/tests/phpunit/tests/MediaWikiTestCaseSchema1Test.php b/tests/phpunit/tests/MediaWikiTestCaseSchema1Test.php index 7af8deeaf3e..b552b39c241 100644 --- a/tests/phpunit/tests/MediaWikiTestCaseSchema1Test.php +++ b/tests/phpunit/tests/MediaWikiTestCaseSchema1Test.php @@ -12,7 +12,7 @@ class MediaWikiTestCaseSchema1Test extends MediaWikiTestCase { public static $hasRun = false; - public function setUp() { + public function setUp() : void { parent::setUp(); // FIXME: fails under postgres $this->markTestSkippedIfDbType( 'postgres' ); diff --git a/tests/phpunit/tests/MediaWikiTestCaseSchema2Test.php b/tests/phpunit/tests/MediaWikiTestCaseSchema2Test.php index 391eec716a1..2bb6e573a0d 100644 --- a/tests/phpunit/tests/MediaWikiTestCaseSchema2Test.php +++ b/tests/phpunit/tests/MediaWikiTestCaseSchema2Test.php @@ -14,7 +14,7 @@ */ class MediaWikiTestCaseSchema2Test extends MediaWikiTestCase { - public function setUp() { + public function setUp() : void { parent::setUp(); // FIXME: fails under postgres $this->markTestSkippedIfDbType( 'postgres' ); diff --git a/tests/phpunit/unit/includes/BadFileLookupTest.php b/tests/phpunit/unit/includes/BadFileLookupTest.php index 6ecfe37d996..4f9ee164a49 100644 --- a/tests/phpunit/unit/includes/BadFileLookupTest.php +++ b/tests/phpunit/unit/includes/BadFileLookupTest.php @@ -104,7 +104,7 @@ WIKITEXT; return $mock; } - public function setUp() { + public function setUp() : void { parent::setUp(); $this->setTemporaryHook( 'BadImage', __CLASS__ . '::badImageHook' ); diff --git a/tests/phpunit/unit/includes/FauxResponseTest.php b/tests/phpunit/unit/includes/FauxResponseTest.php index 0cca53b3cc1..ac460385eab 100644 --- a/tests/phpunit/unit/includes/FauxResponseTest.php +++ b/tests/phpunit/unit/includes/FauxResponseTest.php @@ -24,7 +24,7 @@ class FauxResponseTest extends \MediaWikiUnitTestCase { /** @var FauxResponse */ protected $response; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->response = new FauxResponse; } diff --git a/tests/phpunit/unit/includes/FormOptionsInitializationTest.php b/tests/phpunit/unit/includes/FormOptionsInitializationTest.php index 708956d260f..bb2b9afdf49 100644 --- a/tests/phpunit/unit/includes/FormOptionsInitializationTest.php +++ b/tests/phpunit/unit/includes/FormOptionsInitializationTest.php @@ -20,7 +20,7 @@ class FormOptionsInitializationTest extends \MediaWikiUnitTestCase { * A new fresh and empty FormOptions object to test initialization * with. */ - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->object = TestingAccessWrapper::newFromObject( new FormOptions() ); } diff --git a/tests/phpunit/unit/includes/FormOptionsTest.php b/tests/phpunit/unit/includes/FormOptionsTest.php index e7e41c9aa1d..05bea94bbef 100644 --- a/tests/phpunit/unit/includes/FormOptionsTest.php +++ b/tests/phpunit/unit/includes/FormOptionsTest.php @@ -27,7 +27,7 @@ class FormOptionsTest extends \MediaWikiUnitTestCase { * so we assume the function is well tested already an use it to create * the fixture. */ - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->object = new FormOptions; $this->object->add( 'string1', 'string one' ); diff --git a/tests/phpunit/unit/includes/PathRouterTest.php b/tests/phpunit/unit/includes/PathRouterTest.php index c47050244b7..bfea955ce8d 100644 --- a/tests/phpunit/unit/includes/PathRouterTest.php +++ b/tests/phpunit/unit/includes/PathRouterTest.php @@ -12,7 +12,7 @@ class PathRouterTest extends MediaWikiUnitTestCase { */ protected $basicRouter; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $router = new PathRouter; $router->add( "/wiki/$1" ); diff --git a/tests/phpunit/unit/includes/SiteConfigurationTest.php b/tests/phpunit/unit/includes/SiteConfigurationTest.php index d7901be0d75..8f1e9e08be0 100644 --- a/tests/phpunit/unit/includes/SiteConfigurationTest.php +++ b/tests/phpunit/unit/includes/SiteConfigurationTest.php @@ -7,7 +7,7 @@ class SiteConfigurationTest extends \MediaWikiUnitTestCase { */ protected $mConf; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->mConf = new SiteConfiguration; diff --git a/tests/phpunit/unit/includes/XmlSelectTest.php b/tests/phpunit/unit/includes/XmlSelectTest.php index 54d269e0cee..56ac37578a3 100644 --- a/tests/phpunit/unit/includes/XmlSelectTest.php +++ b/tests/phpunit/unit/includes/XmlSelectTest.php @@ -10,12 +10,12 @@ class XmlSelectTest extends \MediaWikiUnitTestCase { */ protected $select; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->select = new XmlSelect(); } - protected function tearDown() { + protected function tearDown() : void { parent::tearDown(); $this->select = null; } diff --git a/tests/phpunit/unit/includes/debug/logger/monolog/AvroFormatterTest.php b/tests/phpunit/unit/includes/debug/logger/monolog/AvroFormatterTest.php index 65e578b5b91..1f419ee9c00 100644 --- a/tests/phpunit/unit/includes/debug/logger/monolog/AvroFormatterTest.php +++ b/tests/phpunit/unit/includes/debug/logger/monolog/AvroFormatterTest.php @@ -27,7 +27,7 @@ use PHPUnit\Framework\Error\Notice; */ class AvroFormatterTest extends \MediaWikiUnitTestCase { - protected function setUp() { + protected function setUp() : void { if ( !class_exists( 'AvroStringIO' ) ) { $this->markTestSkipped( 'Avro is required for the AvroFormatterTest' ); } diff --git a/tests/phpunit/unit/includes/debug/logger/monolog/KafkaHandlerTest.php b/tests/phpunit/unit/includes/debug/logger/monolog/KafkaHandlerTest.php index b47982b9510..2062db06168 100644 --- a/tests/phpunit/unit/includes/debug/logger/monolog/KafkaHandlerTest.php +++ b/tests/phpunit/unit/includes/debug/logger/monolog/KafkaHandlerTest.php @@ -30,7 +30,7 @@ use Wikimedia\TestingAccessWrapper; */ class KafkaHandlerTest extends \MediaWikiUnitTestCase { - protected function setUp() { + protected function setUp() : void { if ( !class_exists( 'Monolog\Handler\AbstractProcessingHandler' ) || !class_exists( 'Kafka\Produce' ) ) { diff --git a/tests/phpunit/unit/includes/debug/logger/monolog/LineFormatterTest.php b/tests/phpunit/unit/includes/debug/logger/monolog/LineFormatterTest.php index 8da3d9304ea..c0eb8a1d461 100644 --- a/tests/phpunit/unit/includes/debug/logger/monolog/LineFormatterTest.php +++ b/tests/phpunit/unit/includes/debug/logger/monolog/LineFormatterTest.php @@ -28,7 +28,7 @@ use Wikimedia\TestingAccessWrapper; class LineFormatterTest extends \MediaWikiUnitTestCase { - protected function setUp() { + protected function setUp() : void { if ( !class_exists( 'Monolog\Formatter\LineFormatter' ) ) { $this->markTestSkipped( 'This test requires monolog to be installed' ); } diff --git a/tests/phpunit/unit/includes/interwiki/InterwikiLookupAdapterTest.php b/tests/phpunit/unit/includes/interwiki/InterwikiLookupAdapterTest.php index abbd2d778eb..afcad6decee 100644 --- a/tests/phpunit/unit/includes/interwiki/InterwikiLookupAdapterTest.php +++ b/tests/phpunit/unit/includes/interwiki/InterwikiLookupAdapterTest.php @@ -15,7 +15,7 @@ class InterwikiLookupAdapterTest extends \MediaWikiUnitTestCase { */ private $interwikiLookup; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->interwikiLookup = new InterwikiLookupAdapter( diff --git a/tests/phpunit/unit/includes/libs/objectcache/ReplicatedBagOStuffTest.php b/tests/phpunit/unit/includes/libs/objectcache/ReplicatedBagOStuffTest.php index 64d282f4879..446eef35161 100644 --- a/tests/phpunit/unit/includes/libs/objectcache/ReplicatedBagOStuffTest.php +++ b/tests/phpunit/unit/includes/libs/objectcache/ReplicatedBagOStuffTest.php @@ -8,7 +8,7 @@ class ReplicatedBagOStuffTest extends \MediaWikiUnitTestCase { /** @var ReplicatedBagOStuff */ private $cache; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->writeCache = new HashBagOStuff(); diff --git a/tests/phpunit/unit/includes/media/GIFMetadataExtractorTest.php b/tests/phpunit/unit/includes/media/GIFMetadataExtractorTest.php index 10c450d9355..e051d0cafb1 100644 --- a/tests/phpunit/unit/includes/media/GIFMetadataExtractorTest.php +++ b/tests/phpunit/unit/includes/media/GIFMetadataExtractorTest.php @@ -5,7 +5,7 @@ */ class GIFMetadataExtractorTest extends \MediaWikiUnitTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->mediaPath = __DIR__ . '/../../../data/media/'; diff --git a/tests/phpunit/unit/includes/objectcache/MemcachedBagOStuffTest.php b/tests/phpunit/unit/includes/objectcache/MemcachedBagOStuffTest.php index 492212daa84..73a70642f36 100644 --- a/tests/phpunit/unit/includes/objectcache/MemcachedBagOStuffTest.php +++ b/tests/phpunit/unit/includes/objectcache/MemcachedBagOStuffTest.php @@ -6,7 +6,7 @@ class MemcachedBagOStuffTest extends \MediaWikiUnitTestCase { /** @var MemcachedBagOStuff */ private $cache; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->cache = new MemcachedPhpBagOStuff( [ 'keyspace' => 'test', 'servers' => [] ] ); } diff --git a/tests/phpunit/unit/includes/objectcache/RESTBagOStuffTest.php b/tests/phpunit/unit/includes/objectcache/RESTBagOStuffTest.php index 689ac21df07..4cd7e84e907 100644 --- a/tests/phpunit/unit/includes/objectcache/RESTBagOStuffTest.php +++ b/tests/phpunit/unit/includes/objectcache/RESTBagOStuffTest.php @@ -15,7 +15,7 @@ class RESTBagOStuffTest extends \MediaWikiUnitTestCase { */ private $bag; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->client = $this->getMockBuilder( MultiHttpClient::class ) diff --git a/tests/phpunit/unit/includes/objectcache/RedisBagOStuffTest.php b/tests/phpunit/unit/includes/objectcache/RedisBagOStuffTest.php index 5abb78b3c69..72b5b88f9f9 100644 --- a/tests/phpunit/unit/includes/objectcache/RedisBagOStuffTest.php +++ b/tests/phpunit/unit/includes/objectcache/RedisBagOStuffTest.php @@ -10,7 +10,7 @@ class RedisBagOStuffTest extends MediaWikiUnitTestCase { /** @var RedisBagOStuff */ private $cache; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $cache = $this->getMockBuilder( RedisBagOStuff::class ) diff --git a/tests/phpunit/unit/includes/page/ArticleTest.php b/tests/phpunit/unit/includes/page/ArticleTest.php index 5789ad3e217..17c439fde85 100644 --- a/tests/phpunit/unit/includes/page/ArticleTest.php +++ b/tests/phpunit/unit/includes/page/ArticleTest.php @@ -12,14 +12,14 @@ class ArticleTest extends MediaWikiUnitTestCase { private $article; /** creates a title object and its article object */ - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->title = Title::makeTitle( NS_MAIN, 'SomePage' ); $this->article = new Article( $this->title ); } /** cleanup title object and its article object */ - protected function tearDown() { + protected function tearDown() : void { parent::tearDown(); $this->title = null; $this->article = null; diff --git a/tests/phpunit/unit/includes/parser/TidyTest.php b/tests/phpunit/unit/includes/parser/TidyTest.php index 1adb6a6444e..064191a6982 100644 --- a/tests/phpunit/unit/includes/parser/TidyTest.php +++ b/tests/phpunit/unit/includes/parser/TidyTest.php @@ -6,7 +6,7 @@ */ class TidyTest extends \MediaWikiUnitTestCase { - protected function setUp() { + protected function setUp() : void { parent::setUp(); if ( !MWTidy::isEnabled() ) { $this->markTestSkipped( 'Tidy not found' ); diff --git a/tests/phpunit/unit/includes/registration/ExtensionProcessorTest.php b/tests/phpunit/unit/includes/registration/ExtensionProcessorTest.php index 4ad19833a6e..ac6813de7d1 100644 --- a/tests/phpunit/unit/includes/registration/ExtensionProcessorTest.php +++ b/tests/phpunit/unit/includes/registration/ExtensionProcessorTest.php @@ -9,7 +9,7 @@ class ExtensionProcessorTest extends \MediaWikiUnitTestCase { private $dir, $dirname; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->dir = __DIR__ . '/FooBar/extension.json'; $this->dirname = dirname( $this->dir ); diff --git a/tests/phpunit/unit/includes/resourceloader/ResourceLoaderImageTest.php b/tests/phpunit/unit/includes/resourceloader/ResourceLoaderImageTest.php index 34f24daed25..e5e16485653 100644 --- a/tests/phpunit/unit/includes/resourceloader/ResourceLoaderImageTest.php +++ b/tests/phpunit/unit/includes/resourceloader/ResourceLoaderImageTest.php @@ -8,7 +8,7 @@ class ResourceLoaderImageTest extends MediaWikiUnitTestCase { private $imagesPath; - protected function setUp() { + protected function setUp() : void { parent::setUp(); $this->imagesPath = __DIR__ . '/../../../data/resourceloader'; } diff --git a/tests/phpunit/unit/includes/utils/AvroValidatorTest.php b/tests/phpunit/unit/includes/utils/AvroValidatorTest.php index bdf493dfa4e..64c00d72e77 100644 --- a/tests/phpunit/unit/includes/utils/AvroValidatorTest.php +++ b/tests/phpunit/unit/includes/utils/AvroValidatorTest.php @@ -14,7 +14,7 @@ */ class AvroValidatorTest extends MediaWikiUnitTestCase { - public function setUp() { + public function setUp() : void { if ( !class_exists( 'AvroSchema' ) ) { $this->markTestSkipped( 'Avro is required to run the AvroValidatorTest' ); }