diff options
60 files changed, 95 insertions, 95 deletions
diff --git a/tests/phpunit/includes/MediaWikiServicesTest.php b/tests/phpunit/includes/MediaWikiServicesTest.php index 6023a1463cfe..593c5b6f4cca 100644 --- a/tests/phpunit/includes/MediaWikiServicesTest.php +++ b/tests/phpunit/includes/MediaWikiServicesTest.php @@ -345,7 +345,7 @@ class MediaWikiServicesTest extends MediaWikiIntegrationTestCase { $this->assertInstanceOf( $type, $service ); } - public function provideGetService() { + public static function provideGetService() { global $IP; $serviceList = require "$IP/includes/ServiceWiring.php"; $ret = []; diff --git a/tests/phpunit/includes/WikiMapTest.php b/tests/phpunit/includes/WikiMapTest.php index efa59f82e797..f7d67aa4c862 100644 --- a/tests/phpunit/includes/WikiMapTest.php +++ b/tests/phpunit/includes/WikiMapTest.php @@ -213,7 +213,7 @@ class WikiMapTest extends MediaWikiLangTestCase { ); } - public function provideGetWikiFromUrl() { + public static function provideGetWikiFromUrl() { return [ [ 'http://this.wiki.org', 'thiswiki' ], [ 'https://this.wiki.org', 'thiswiki' ], @@ -239,7 +239,7 @@ class WikiMapTest extends MediaWikiLangTestCase { $this->assertEquals( $wiki, WikiMap::getWikiFromUrl( $url ) ); } - public function provideGetWikiIdFromDbDomain() { + public static function provideGetWikiIdFromDbDomain() { return [ [ 'db-prefix_', 'db-prefix_' ], [ WikiMap::getCurrentWikiId(), WikiMap::getCurrentWikiId() ], @@ -281,7 +281,7 @@ class WikiMapTest extends MediaWikiLangTestCase { $this->assertTrue( WikiMap::isCurrentWikiDbDomain( WikiMap::getCurrentWikiDbDomain() ) ); } - public function provideIsCurrentWikiId() { + public static function provideIsCurrentWikiId() { return [ [ 'db', 'db', null, '' ], [ 'db-schema-','db', 'schema', '' ], diff --git a/tests/phpunit/includes/api/ApiParseTest.php b/tests/phpunit/includes/api/ApiParseTest.php index ae83005fd98d..ca4e092a716e 100644 --- a/tests/phpunit/includes/api/ApiParseTest.php +++ b/tests/phpunit/includes/api/ApiParseTest.php @@ -588,7 +588,7 @@ class ApiParseTest extends ApiTestCase { $this->assertParsedToRegexp( $expected, $res ); } - public function providerTestParsoid() { + public static function providerTestParsoid() { // Legacy parses, with and without pre-existing content. $expected = '!^<p><a href="[^"]*" title="Foo">Foo</a>\n</p>$!'; yield [ false, false, $expected ]; diff --git a/tests/phpunit/includes/api/ApiUserrightsTest.php b/tests/phpunit/includes/api/ApiUserrightsTest.php index 71396a7b6964..6d208546cdb9 100644 --- a/tests/phpunit/includes/api/ApiUserrightsTest.php +++ b/tests/phpunit/includes/api/ApiUserrightsTest.php @@ -295,7 +295,7 @@ class ApiUserrightsTest extends ApiTestCase { $this->doSuccessfulRightsChange( $expectedGroups, $params, $user ); } - public function addAndRemoveGroupsProvider() { + public static function addAndRemoveGroupsProvider() { return [ 'Simple add' => [ [ [ 'sysop' ], [] ], diff --git a/tests/phpunit/includes/api/Validator/ApiParamValidatorTest.php b/tests/phpunit/includes/api/Validator/ApiParamValidatorTest.php index ee8f14de2c5f..4438c230d083 100644 --- a/tests/phpunit/includes/api/Validator/ApiParamValidatorTest.php +++ b/tests/phpunit/includes/api/Validator/ApiParamValidatorTest.php @@ -172,7 +172,7 @@ class ApiParamValidatorTest extends ApiTestCase { $this->assertEquals( $expect, $validator->checkSettings( $module, $params, $name, [] ) ); } - public function provideCheckSettings() { + public static function provideCheckSettings() { $keys = [ 'Y', ApiBase::PARAM_RANGE_ENFORCE, ApiBase::PARAM_HELP_MSG, ApiBase::PARAM_HELP_MSG_APPEND, ApiBase::PARAM_HELP_MSG_INFO, ApiBase::PARAM_HELP_MSG_PER_VALUE, ApiBase::PARAM_TEMPLATE_VARS, diff --git a/tests/phpunit/includes/api/query/ApiQueryPrefixSearchTest.php b/tests/phpunit/includes/api/query/ApiQueryPrefixSearchTest.php index d3b7e7b4ffa4..9c6ca1d37d93 100644 --- a/tests/phpunit/includes/api/query/ApiQueryPrefixSearchTest.php +++ b/tests/phpunit/includes/api/query/ApiQueryPrefixSearchTest.php @@ -25,7 +25,7 @@ class ApiQueryPrefixSearchTest extends ApiTestCase { MockCompletionSearchEngine::addMockResults( self::TEST_QUERY, $results ); } - public function offsetContinueProvider() { + public static function offsetContinueProvider() { return [ 'no offset' => [ 2, 2, 0, 2 ], 'with offset' => [ 7, 2, 5, 2 ], diff --git a/tests/phpunit/includes/api/query/ApiQuerySiteinfoTest.php b/tests/phpunit/includes/api/query/ApiQuerySiteinfoTest.php index bc2694a4f166..f95fdd1bc537 100644 --- a/tests/phpunit/includes/api/query/ApiQuerySiteinfoTest.php +++ b/tests/phpunit/includes/api/query/ApiQuerySiteinfoTest.php @@ -247,7 +247,7 @@ class ApiQuerySiteinfoTest extends ApiTestCase { $this->assertSame( $expected, $data ); } - public function interwikiMapProvider() { + public static function interwikiMapProvider() { return [ [ 'local' ], [ '!local' ], [ null ] ]; } @@ -283,7 +283,7 @@ class ApiQuerySiteinfoTest extends ApiTestCase { $this->assertSame( $expected, $data ); } - public function dbReplLagProvider() { + public static function dbReplLagProvider() { return [ 'no hostnames, no showalldb' => [ false, false ], 'no hostnames, showalldb' => [ false, true ], @@ -407,7 +407,7 @@ class ApiQuerySiteinfoTest extends ApiTestCase { $this->assertSame( $expected, $this->doQuery( 'fileextensions' ) ); } - public function groupsProvider() { + public static function groupsProvider() { return [ 'numingroup' => [ true ], 'nonumingroup' => [ false ], @@ -536,7 +536,7 @@ class ApiQuerySiteinfoTest extends ApiTestCase { ); } - public function rightsInfoProvider() { + public static function rightsInfoProvider() { $licenseTitle = Title::makeTitle( 0, 'License' ); $licenseUrl = 'http://license.example/'; @@ -594,7 +594,7 @@ class ApiQuerySiteinfoTest extends ApiTestCase { $this->assertSame( $expected, $data ); } - public function languagesProvider() { + public static function languagesProvider() { return [ [ null ], [ 'fr' ] ]; } diff --git a/tests/phpunit/includes/api/query/ApiQueryWatchlistRawIntegrationTest.php b/tests/phpunit/includes/api/query/ApiQueryWatchlistRawIntegrationTest.php index 98eb775bbb54..388fa4099351 100644 --- a/tests/phpunit/includes/api/query/ApiQueryWatchlistRawIntegrationTest.php +++ b/tests/phpunit/includes/api/query/ApiQueryWatchlistRawIntegrationTest.php @@ -367,7 +367,7 @@ class ApiQueryWatchlistRawIntegrationTest extends ApiTestCase { ); } - public function fromTitleToTitleContinueComboProvider() { + public static function fromTitleToTitleContinueComboProvider() { return [ [ [ @@ -428,7 +428,7 @@ class ApiQueryWatchlistRawIntegrationTest extends ApiTestCase { $this->assertEquals( $expectedItems, $this->getItemsFromApiResponse( $result ) ); } - public function fromTitleToTitleContinueSelfContradictoryComboProvider() { + public static function fromTitleToTitleContinueSelfContradictoryComboProvider() { return [ [ [ diff --git a/tests/phpunit/includes/auth/ConfirmLinkAuthenticationRequestTest.php b/tests/phpunit/includes/auth/ConfirmLinkAuthenticationRequestTest.php index 8442ee3f2a32..086788cd056c 100644 --- a/tests/phpunit/includes/auth/ConfirmLinkAuthenticationRequestTest.php +++ b/tests/phpunit/includes/auth/ConfirmLinkAuthenticationRequestTest.php @@ -50,7 +50,7 @@ class ConfirmLinkAuthenticationRequestTest extends AuthenticationRequestTestCase return $reqs; } - public function provideLoadFromSubmission() { + public static function provideLoadFromSubmission() { $reqs = self::getLinkRequests(); return [ diff --git a/tests/phpunit/includes/changes/OldChangesListTest.php b/tests/phpunit/includes/changes/OldChangesListTest.php index aabef68d7a6a..424577cecd2a 100644 --- a/tests/phpunit/includes/changes/OldChangesListTest.php +++ b/tests/phpunit/includes/changes/OldChangesListTest.php @@ -41,7 +41,7 @@ class OldChangesListTest extends MediaWikiLangTestCase { $this->assertMatchesRegularExpression( $expected, $line, $message ); } - public function recentChangesLine_CssForLineNumberProvider() { + public static function recentChangesLine_CssForLineNumberProvider() { return [ [ '/mw-line-odd/', 1, 'odd line number' ], [ '/mw-line-even/', 2, 'even line number' ] diff --git a/tests/phpunit/includes/collation/CollationTest.php b/tests/phpunit/includes/collation/CollationTest.php index f8dd173758ff..5eecb15c70e8 100644 --- a/tests/phpunit/includes/collation/CollationTest.php +++ b/tests/phpunit/includes/collation/CollationTest.php @@ -96,7 +96,7 @@ class CollationTest extends MediaWikiLangTestCase { $this->assertEquals( $firstLetter, $col->getFirstLetter( $string ) ); } - public function firstLetterProvider() { + public static function firstLetterProvider() { return [ [ 'uppercase', 'Abc', 'A' ], [ 'uppercase', 'abc', 'A' ], diff --git a/tests/phpunit/includes/content/Transform/ContentTransformerTest.php b/tests/phpunit/includes/content/Transform/ContentTransformerTest.php index c82907e3af45..289b399160c5 100644 --- a/tests/phpunit/includes/content/Transform/ContentTransformerTest.php +++ b/tests/phpunit/includes/content/Transform/ContentTransformerTest.php @@ -5,7 +5,7 @@ use MediaWiki\Title\Title; class ContentTransformerTest extends MediaWikiIntegrationTestCase { - public function preSaveTransformProvider() { + public static function preSaveTransformProvider() { return [ [ new WikitextContent( 'Test ~~~' ), @@ -31,7 +31,7 @@ class ContentTransformerTest extends MediaWikiIntegrationTestCase { $this->assertSame( $expectedContainText, $newContent->serialize() ); } - public function preloadTransformProvider() { + public static function preloadTransformProvider() { return [ [ new WikitextContent( '{{Foo}}<noinclude> censored</noinclude> information <!-- is very secret -->' ), diff --git a/tests/phpunit/includes/filerepo/file/FileTest.php b/tests/phpunit/includes/filerepo/file/FileTest.php index 5d75da15fcad..21f8b8afc858 100644 --- a/tests/phpunit/includes/filerepo/file/FileTest.php +++ b/tests/phpunit/includes/filerepo/file/FileTest.php @@ -58,7 +58,7 @@ class FileTest extends MediaWikiMediaTestCase { $data['message'] ); } - public function getThumbnailBucketProvider() { + public static function getThumbnailBucketProvider() { $defaultBuckets = [ 256, 512, 1024, 2048, 4096 ]; return [ @@ -203,7 +203,7 @@ class FileTest extends MediaWikiMediaTestCase { ); } - public function getThumbnailSourceProvider() { + public static function getThumbnailSourceProvider() { return [ [ [ 'supportsBucketing' => true, diff --git a/tests/phpunit/includes/language/LanguageConverterFactoryTest.php b/tests/phpunit/includes/language/LanguageConverterFactoryTest.php index 7cb3437bf81b..5a715bae80f8 100644 --- a/tests/phpunit/includes/language/LanguageConverterFactoryTest.php +++ b/tests/phpunit/includes/language/LanguageConverterFactoryTest.php @@ -127,7 +127,7 @@ class LanguageConverterFactoryTest extends MediaWikiLangTestCase { } } - public function booleanProvider() { + public static function booleanProvider() { return [ [ false, false, false ], [ false, false, true ], @@ -220,7 +220,7 @@ class LanguageConverterFactoryTest extends MediaWikiLangTestCase { } } - public function codeProvider() { + public static function codeProvider() { $trivialWithNothingElseCodes = [ 'aa', 'ab', 'abs', 'ace', 'ady', 'ady-cyrl', 'aeb', 'aeb-arab', 'aeb-latn', 'af', 'ak', 'aln', 'als', 'am', 'an', 'ang', 'anp', 'ar', 'arc', 'arn', diff --git a/tests/phpunit/includes/language/LanguageIntegrationTest.php b/tests/phpunit/includes/language/LanguageIntegrationTest.php index 4d41443104fa..1cd938de6a3e 100644 --- a/tests/phpunit/includes/language/LanguageIntegrationTest.php +++ b/tests/phpunit/includes/language/LanguageIntegrationTest.php @@ -1683,7 +1683,7 @@ class LanguageIntegrationTest extends LanguageClassesTestCase { $this->assertEquals( $number, $normalisedNum ); } - public function parseFormattedNumberProvider() { + public static function parseFormattedNumberProvider() { return [ [ 'de', 377.01 ], [ 'fa', 334 ], diff --git a/tests/phpunit/includes/linkeddata/PageDataRequestHandlerTest.php b/tests/phpunit/includes/linkeddata/PageDataRequestHandlerTest.php index e9bcf782ffd4..9dc02c9b4fec 100644 --- a/tests/phpunit/includes/linkeddata/PageDataRequestHandlerTest.php +++ b/tests/phpunit/includes/linkeddata/PageDataRequestHandlerTest.php @@ -79,7 +79,7 @@ class PageDataRequestHandlerTest extends \MediaWikiLangTestCase { return $output; } - public function handleRequestProvider() { + public static function handleRequestProvider() { $cases = []; $cases[] = [ '', [], [], 'Invalid title', 400 ]; diff --git a/tests/phpunit/includes/mail/MailAddressTest.php b/tests/phpunit/includes/mail/MailAddressTest.php index 5b51485a48e3..97c6940c3ccc 100644 --- a/tests/phpunit/includes/mail/MailAddressTest.php +++ b/tests/phpunit/includes/mail/MailAddressTest.php @@ -46,7 +46,7 @@ class MailAddressTest extends MediaWikiIntegrationTestCase { $this->assertSame( $expected, $first->equals( $second ) ); } - public function provideEquals(): Generator { + public static function provideEquals(): Generator { $base = new MailAddress( 'a@b.c', 'name', 'realname' ); yield 'Different addresses' => [ $base, new MailAddress( 'xxx', 'name', 'realname' ), false ]; diff --git a/tests/phpunit/includes/pager/RangeChronologicalPagerTest.php b/tests/phpunit/includes/pager/RangeChronologicalPagerTest.php index 58c5fb30d09b..b5da892eba5c 100644 --- a/tests/phpunit/includes/pager/RangeChronologicalPagerTest.php +++ b/tests/phpunit/includes/pager/RangeChronologicalPagerTest.php @@ -24,7 +24,7 @@ class RangeChronologicalPagerTest extends MediaWikiIntegrationTestCase { /** * Data provider in [ input year, input month, input day, expected timestamp output ] format */ - public function getDateCondProvider() { + public static function getDateCondProvider() { return [ [ 2016, 12, 5, '20161206000000' ], [ 2016, 12, 31, '20170101000000' ], @@ -49,7 +49,7 @@ class RangeChronologicalPagerTest extends MediaWikiIntegrationTestCase { /** * Data provider in [ start, end, [ expected output has start condition, has end cond ] ] format */ - public function getDateRangeCondProvider() { + public static function getDateRangeCondProvider() { $db = wfGetDB( DB_PRIMARY ); return [ @@ -88,7 +88,7 @@ class RangeChronologicalPagerTest extends MediaWikiIntegrationTestCase { $this->assertNull( $pager->getDateRangeCond( $start, $end ) ); } - public function getDateRangeCondInvalidProvider() { + public static function getDateRangeCondInvalidProvider() { return [ [ '-2016-12-01', '2017-12-01', ], [ '2016-12-01', '-2017-12-01', ], diff --git a/tests/phpunit/includes/parser/MagicVariableTest.php b/tests/phpunit/includes/parser/MagicVariableTest.php index cdcafd9a8c71..7fffff2d9b55 100644 --- a/tests/phpunit/includes/parser/MagicVariableTest.php +++ b/tests/phpunit/includes/parser/MagicVariableTest.php @@ -157,7 +157,7 @@ class MagicVariableTest extends MediaWikiIntegrationTestCase { $this->assertUnPadded( 'revisionmonth1', $month ); } - public function provideCurrentUnitTimestampWords() { + public static function provideCurrentUnitTimestampWords() { return [ // Afternoon [ 'currentmonth', '20200208153011', '02', 604800 ], @@ -204,7 +204,7 @@ class MagicVariableTest extends MediaWikiIntegrationTestCase { $this->assertSame( $expTTL, $this->testParser->getOutput()->getCacheExpiry() ); } - public function provideLocalUnitTimestampWords() { + public static function provideLocalUnitTimestampWords() { // NOTE: Europe/Stockholm DST applies Sun, Mar 26, 2023 2:00 - Sun, Oct 29, 2023 3:00AM return [ // Afternoon diff --git a/tests/phpunit/includes/search/SearchEnginePrefixTest.php b/tests/phpunit/includes/search/SearchEnginePrefixTest.php index 751f64efd70a..b34a9eb4706f 100644 --- a/tests/phpunit/includes/search/SearchEnginePrefixTest.php +++ b/tests/phpunit/includes/search/SearchEnginePrefixTest.php @@ -366,7 +366,7 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase { ); } - public function paginationProvider() { + public static function paginationProvider() { $res = [ 'Example', 'Example Bar', 'Example Foo', 'Example Foo/Bar' ]; return [ 'With less than requested results no pagination' => [ diff --git a/tests/phpunit/includes/search/SearchHighlighterTest.php b/tests/phpunit/includes/search/SearchHighlighterTest.php index cb6fa7e1e651..d5c535eac332 100644 --- a/tests/phpunit/includes/search/SearchHighlighterTest.php +++ b/tests/phpunit/includes/search/SearchHighlighterTest.php @@ -14,7 +14,7 @@ class SearchHighlighterTest extends \MediaWikiIntegrationTestCase { $this->assertEquals( $expectedOutput, $actual ); } - public function provideHighlightSimple() { + public static function provideHighlightSimple() { return [ 'no match' => [ 'this is a very simple text.', diff --git a/tests/phpunit/includes/search/TitleMatcherTest.php b/tests/phpunit/includes/search/TitleMatcherTest.php index 9bf14b5d2e7c..4ce149005386 100644 --- a/tests/phpunit/includes/search/TitleMatcherTest.php +++ b/tests/phpunit/includes/search/TitleMatcherTest.php @@ -17,7 +17,7 @@ class TitleMatcherTest extends MediaWikiIntegrationTestCase { $this->overrideConfigValue( MainConfigNames::UsePigLatinVariant, false ); } - public function nearMatchProvider() { + public static function nearMatchProvider() { return [ 'empty request returns nothing' => [ null, 'en', '', 'Near Match Test' ], 'with a hash returns nothing' => [ null, 'en', '#near match test', 'Near Match Test' ], @@ -114,7 +114,7 @@ class TitleMatcherTest extends MediaWikiIntegrationTestCase { $this->assertEquals( $expected, $title === null ? null : (string)$title ); } - public function hooksProvider() { + public static function hooksProvider() { return [ 'SearchGetNearMatchBefore' => [ 'SearchGetNearMatchBefore' ], 'SearchAfterNoDirectMatch' => [ 'SearchAfterNoDirectMatch' ], diff --git a/tests/phpunit/includes/site/MediaWikiSiteTest.php b/tests/phpunit/includes/site/MediaWikiSiteTest.php index c5ef78ef3018..be959a223972 100644 --- a/tests/phpunit/includes/site/MediaWikiSiteTest.php +++ b/tests/phpunit/includes/site/MediaWikiSiteTest.php @@ -45,7 +45,7 @@ class MediaWikiSiteTest extends SiteTest { $this->assertEquals( 'Foo', $site->normalizePageName( ' foo ' ) ); } - public function fileUrlProvider() { + public static function fileUrlProvider() { return [ // url, filepath, path arg, expected [ 'https://en.wikipedia.org', '/w/$1', 'api.php', 'https://en.wikipedia.org/w/api.php' ], diff --git a/tests/phpunit/includes/skins/SkinTemplateTest.php b/tests/phpunit/includes/skins/SkinTemplateTest.php index c4691eb32519..cb1292137a94 100644 --- a/tests/phpunit/includes/skins/SkinTemplateTest.php +++ b/tests/phpunit/includes/skins/SkinTemplateTest.php @@ -35,7 +35,7 @@ class SkinTemplateTest extends MediaWikiIntegrationTestCase { ); } - public function makeListItemProvider() { + public static function makeListItemProvider() { return [ [ '<li class="class mw-list-item" title="itemtitle"><a href="url" title="title">text</a></li>', diff --git a/tests/phpunit/includes/sparql/SparqlClientTest.php b/tests/phpunit/includes/sparql/SparqlClientTest.php index 8937ccf53385..48225072da52 100644 --- a/tests/phpunit/includes/sparql/SparqlClientTest.php +++ b/tests/phpunit/includes/sparql/SparqlClientTest.php @@ -86,7 +86,7 @@ JSON; $result = $client->query( "TEST SPARQL 3" ); } - public function optionsProvider() { + public static function optionsProvider() { return [ 'defaults' => [ 'TEST тест SPARQL 4 ', diff --git a/tests/phpunit/includes/specialpage/ChangesListSpecialPageTest.php b/tests/phpunit/includes/specialpage/ChangesListSpecialPageTest.php index 698c0f6f5718..4e4cef9b3e11 100644 --- a/tests/phpunit/includes/specialpage/ChangesListSpecialPageTest.php +++ b/tests/phpunit/includes/specialpage/ChangesListSpecialPageTest.php @@ -956,7 +956,7 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase ]; } - public function provideGetFilterConflicts() { + public static function provideGetFilterConflicts() { return [ [ "parameters" => [], diff --git a/tests/phpunit/includes/specialpage/SpecialPageTest.php b/tests/phpunit/includes/specialpage/SpecialPageTest.php index 73d053a649c2..6043ba423933 100644 --- a/tests/phpunit/includes/specialpage/SpecialPageTest.php +++ b/tests/phpunit/includes/specialpage/SpecialPageTest.php @@ -30,7 +30,7 @@ class SpecialPageTest extends MediaWikiIntegrationTestCase { $this->assertEquals( $expected, $title ); } - public function getTitleForProvider() { + public static function getTitleForProvider() { return [ [ 'UserLogin', 'Userlogin' ] ]; @@ -52,7 +52,7 @@ class SpecialPageTest extends MediaWikiIntegrationTestCase { $this->assertEquals( $expected, $title ); } - public function getTitleForWithWarningProvider() { + public static function getTitleForWithWarningProvider() { return [ [ Title::makeTitle( NS_SPECIAL, 'UserLogin' ), 'UserLogin' ] ]; @@ -76,7 +76,7 @@ class SpecialPageTest extends MediaWikiIntegrationTestCase { $specialPage->requireLogin( ...array_filter( [ $reason, $title ] ) ); } - public function requireLoginAnonProvider() { + public static function requireLoginAnonProvider() { $lang = 'en'; $expected1 = wfMessage( 'exception-nologin-text' )->inLanguage( $lang )->text(); diff --git a/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php b/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php index 894ca4197057..3dd0a637ba2f 100644 --- a/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php +++ b/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php @@ -103,7 +103,7 @@ class BlockListPagerTest extends MediaWikiIntegrationTestCase { /** * Test empty values. */ - public function formatValueEmptyProvider() { + public static function formatValueEmptyProvider() { return [ [ 'test', @@ -122,7 +122,7 @@ class BlockListPagerTest extends MediaWikiIntegrationTestCase { /** * Test the default row values. */ - public function formatValueDefaultProvider() { + public static function formatValueDefaultProvider() { $row = (object)[ 'ipb_user' => 0, 'ipb_address' => '127.0.0.1', diff --git a/tests/phpunit/includes/title/NaiveImportTitleFactoryTest.php b/tests/phpunit/includes/title/NaiveImportTitleFactoryTest.php index d03f4951c176..50b5b71de948 100644 --- a/tests/phpunit/includes/title/NaiveImportTitleFactoryTest.php +++ b/tests/phpunit/includes/title/NaiveImportTitleFactoryTest.php @@ -40,7 +40,7 @@ class NaiveImportTitleFactoryTest extends MediaWikiIntegrationTestCase { ] ); } - public function basicProvider() { + public static function basicProvider() { return [ [ new ForeignTitle( 0, '', 'MainNamespaceArticle' ), diff --git a/tests/phpunit/includes/title/NamespaceImportTitleFactoryTest.php b/tests/phpunit/includes/title/NamespaceImportTitleFactoryTest.php index 08471c937001..27cc8b66c641 100644 --- a/tests/phpunit/includes/title/NamespaceImportTitleFactoryTest.php +++ b/tests/phpunit/includes/title/NamespaceImportTitleFactoryTest.php @@ -36,7 +36,7 @@ class NamespaceImportTitleFactoryTest extends MediaWikiIntegrationTestCase { $this->setContentLang( 'en' ); } - public function basicProvider() { + public static function basicProvider() { return [ [ new ForeignTitle( 0, '', 'MainNamespaceArticle' ), diff --git a/tests/phpunit/includes/title/SubpageImportTitleFactoryTest.php b/tests/phpunit/includes/title/SubpageImportTitleFactoryTest.php index a10e0de39c72..c2b5c0fdec36 100644 --- a/tests/phpunit/includes/title/SubpageImportTitleFactoryTest.php +++ b/tests/phpunit/includes/title/SubpageImportTitleFactoryTest.php @@ -48,7 +48,7 @@ class SubpageImportTitleFactoryTest extends MediaWikiIntegrationTestCase { ); } - public function basicProvider() { + public static function basicProvider() { return [ [ new ForeignTitle( 0, '', 'MainNamespaceArticle' ), diff --git a/tests/phpunit/includes/watcheditem/WatchedItemQueryServiceIntegrationTest.php b/tests/phpunit/includes/watcheditem/WatchedItemQueryServiceIntegrationTest.php index 06f5eb587567..e7a92f1c7e36 100644 --- a/tests/phpunit/includes/watcheditem/WatchedItemQueryServiceIntegrationTest.php +++ b/tests/phpunit/includes/watcheditem/WatchedItemQueryServiceIntegrationTest.php @@ -146,7 +146,7 @@ class WatchedItemQueryServiceIntegrationTest extends MediaWikiIntegrationTestCas $this->assertCount( $initialCount + 4, $result4 ); } - public function invalidWatchlistTokenProvider() { + public static function invalidWatchlistTokenProvider() { return [ [ 'wrongToken' ], [ '' ], diff --git a/tests/phpunit/integration/includes/Rest/Handler/PageRedirectHandlerTest.php b/tests/phpunit/integration/includes/Rest/Handler/PageRedirectHandlerTest.php index a1fef6923573..16d27627080a 100644 --- a/tests/phpunit/integration/includes/Rest/Handler/PageRedirectHandlerTest.php +++ b/tests/phpunit/integration/includes/Rest/Handler/PageRedirectHandlerTest.php @@ -181,7 +181,7 @@ class PageRedirectHandlerTest extends MediaWikiIntegrationTestCase { $this->assertUrlQueryParameters( $headerLocation, $queryParams ); } - public function permanentRedirectProvider() { + public static function permanentRedirectProvider() { yield [ 'source', '/page/{title}', [], [ 'flavor' => 'edit', 'dummy' => 'test' ] ]; yield [ 'bare', '/page/{title}/bare' ]; yield [ 'html', '/page/{title}/html' ]; diff --git a/tests/phpunit/integration/includes/parser/Parsoid/ParsoidParserTest.php b/tests/phpunit/integration/includes/parser/Parsoid/ParsoidParserTest.php index 007437c95c87..ee361a5239d7 100644 --- a/tests/phpunit/integration/includes/parser/Parsoid/ParsoidParserTest.php +++ b/tests/phpunit/integration/includes/parser/Parsoid/ParsoidParserTest.php @@ -28,7 +28,7 @@ class ParsoidParserTest extends MediaWikiIntegrationTestCase { $this->assertStringContainsString( $expected, $html ); } - public function provideParsoidParserHtml() { + public static function provideParsoidParserHtml() { return [ [ [ 'Hello, World' ], 'Hello, World' ], [ [ '__NOTOC__' ], '<meta property="mw:PageProp/notoc"' ], diff --git a/tests/phpunit/integration/includes/user/ActorStoreTest.php b/tests/phpunit/integration/includes/user/ActorStoreTest.php index 77cc1434423b..915c661cf008 100644 --- a/tests/phpunit/integration/includes/user/ActorStoreTest.php +++ b/tests/phpunit/integration/includes/user/ActorStoreTest.php @@ -316,7 +316,7 @@ class ActorStoreTest extends ActorStoreTestBase { $this->assertSameActors( $expected, $actor, $wikiId ); } - public function provideNewActorFromRowFields_exception() { + public static function provideNewActorFromRowFields_exception() { yield 'empty name' => [ 42, // $actorId '', // $name diff --git a/tests/phpunit/maintenance/TextPassDumperDatabaseTest.php b/tests/phpunit/maintenance/TextPassDumperDatabaseTest.php index 7bd2c333ff07..0083fa839d2b 100644 --- a/tests/phpunit/maintenance/TextPassDumperDatabaseTest.php +++ b/tests/phpunit/maintenance/TextPassDumperDatabaseTest.php @@ -503,7 +503,7 @@ class TextPassDumperDatabaselessTest extends MediaWikiLangTestCase { * * @dataProvider bufferSizeProvider */ - public function bufferSizeProvider() { + public static function bufferSizeProvider() { // expected, bufferSize to initialize with, message return [ [ 512 * 1024, 512 * 1024, "Setting 512 KiB is not effective" ], diff --git a/tests/phpunit/maintenance/deleteAutoPatrolLogsTest.php b/tests/phpunit/maintenance/deleteAutoPatrolLogsTest.php index 809e6eefea9f..86d73eff839b 100644 --- a/tests/phpunit/maintenance/deleteAutoPatrolLogsTest.php +++ b/tests/phpunit/maintenance/deleteAutoPatrolLogsTest.php @@ -144,7 +144,7 @@ class DeleteAutoPatrolLogsTest extends MaintenanceBaseTestCase { $dbw->insert( 'logging', $logs ); } - public function runProvider() { + public static function runProvider() { $allRows = [ (object)[ 'log_type' => 'patrol', diff --git a/tests/phpunit/unit/includes/ParamValidator/TypeDef/UserDefTest.php b/tests/phpunit/unit/includes/ParamValidator/TypeDef/UserDefTest.php index 50c4281a9c4d..6c6135d926aa 100644 --- a/tests/phpunit/unit/includes/ParamValidator/TypeDef/UserDefTest.php +++ b/tests/phpunit/unit/includes/ParamValidator/TypeDef/UserDefTest.php @@ -411,7 +411,7 @@ class UserDefTest extends TypeDefTestCase { $this->assertUserIdentity( $res, 0, "Unknown user" ); } - public function provideMissingId() { + public static function provideMissingId() { yield "0 no longer matches request ip" => [ 0 ]; yield "Id with no user" => [ 6 ]; } diff --git a/tests/phpunit/unit/includes/Permissions/RestrictionStoreTest.php b/tests/phpunit/unit/includes/Permissions/RestrictionStoreTest.php index 9acec0500b9b..2862a84b221b 100644 --- a/tests/phpunit/unit/includes/Permissions/RestrictionStoreTest.php +++ b/tests/phpunit/unit/includes/Permissions/RestrictionStoreTest.php @@ -829,7 +829,7 @@ class RestrictionStoreTest extends MediaWikiUnitTestCase { $this->assertSame( $expected, $obj->listAllRestrictionTypes( ...$args ) ); } - public function provideListAllRestrictionTypes() { + public static function provideListAllRestrictionTypes() { $expandedRestrictions = array_merge( self::DEFAULT_RESTRICTION_TYPES, [ 'solidify' ] ); return [ 'Exists' => [ [ 'edit', 'move', 'upload' ], [ true ] ], diff --git a/tests/phpunit/unit/includes/Revision/MutableRevisionSlotsTest.php b/tests/phpunit/unit/includes/Revision/MutableRevisionSlotsTest.php index 37f54786e2e4..db70f86913bd 100644 --- a/tests/phpunit/unit/includes/Revision/MutableRevisionSlotsTest.php +++ b/tests/phpunit/unit/includes/Revision/MutableRevisionSlotsTest.php @@ -23,7 +23,7 @@ class MutableRevisionSlotsTest extends RevisionSlotsTest { return new MutableRevisionSlots( $slots ); } - public function provideConstructorFailue() { + public static function provideConstructorFailue() { yield 'array or the wrong thing' => [ [ 1, 2, 3 ] ]; diff --git a/tests/phpunit/unit/includes/Revision/RevisionSlotsTest.php b/tests/phpunit/unit/includes/Revision/RevisionSlotsTest.php index c2cabd96d6f1..46d1441fa46d 100644 --- a/tests/phpunit/unit/includes/Revision/RevisionSlotsTest.php +++ b/tests/phpunit/unit/includes/Revision/RevisionSlotsTest.php @@ -36,7 +36,7 @@ class RevisionSlotsTest extends MediaWikiUnitTestCase { return new RevisionSlots( $slots ); } - public function provideConstructorFailue() { + public static function provideConstructorFailue() { yield 'not an array or callable' => [ 'foo' ]; diff --git a/tests/phpunit/unit/includes/composer/ComposerVersionNormalizerTest.php b/tests/phpunit/unit/includes/composer/ComposerVersionNormalizerTest.php index 7682471f0e92..ab269b869762 100644 --- a/tests/phpunit/unit/includes/composer/ComposerVersionNormalizerTest.php +++ b/tests/phpunit/unit/includes/composer/ComposerVersionNormalizerTest.php @@ -19,7 +19,7 @@ class ComposerVersionNormalizerTest extends MediaWikiUnitTestCase { $normalizer->normalizeSuffix( $nonString ); } - public function nonStringProvider() { + public static function nonStringProvider() { return [ [ null ], [ 42 ], @@ -69,7 +69,7 @@ class ComposerVersionNormalizerTest extends MediaWikiUnitTestCase { ); } - public function complexVersionProvider() { + public static function complexVersionProvider() { return [ [ '1.22.0alpha', '1.22.0-alpha' ], [ '1.22.0RC', '1.22.0-RC' ], @@ -102,7 +102,7 @@ class ComposerVersionNormalizerTest extends MediaWikiUnitTestCase { ); } - public function fourLevelVersionsProvider() { + public static function fourLevelVersionsProvider() { return [ [ '1.22.0.0' ], [ '1.19.2.4' ], @@ -128,7 +128,7 @@ class ComposerVersionNormalizerTest extends MediaWikiUnitTestCase { ); } - public function levelNormalizationProvider() { + public static function levelNormalizationProvider() { return [ [ '1.22.0.0', '1.22' ], [ '1.22.0.0', '1.22.0' ], @@ -146,7 +146,7 @@ class ComposerVersionNormalizerTest extends MediaWikiUnitTestCase { $this->assertRemainsUnchanged( $invalidVersion ); } - public function invalidVersionProvider() { + public static function invalidVersionProvider() { return [ [ '1.221-a' ], [ '1.221-' ], diff --git a/tests/phpunit/unit/includes/content/WikitextContentHandlerTest.php b/tests/phpunit/unit/includes/content/WikitextContentHandlerTest.php index 6b5ea76b6f82..aa0eb54612b1 100644 --- a/tests/phpunit/unit/includes/content/WikitextContentHandlerTest.php +++ b/tests/phpunit/unit/includes/content/WikitextContentHandlerTest.php @@ -208,7 +208,7 @@ class WikitextContentHandlerTest extends MediaWikiUnitTestCase { $method->invokeArgs( $handler, [ $content, $cpoParams, &$parserOutput ] ); } - public function provideFillParserOutput() { + public static function provideFillParserOutput() { return [ [ false ], [ true ] ]; } } diff --git a/tests/phpunit/unit/includes/db/MWLBFactoryTest.php b/tests/phpunit/unit/includes/db/MWLBFactoryTest.php index 2c2f5d475011..4b91394765e1 100644 --- a/tests/phpunit/unit/includes/db/MWLBFactoryTest.php +++ b/tests/phpunit/unit/includes/db/MWLBFactoryTest.php @@ -55,7 +55,7 @@ class MWLBFactoryTest extends MediaWikiUnitTestCase { ); } - public function getLBFactoryClassProvider() { + public static function getLBFactoryClassProvider() { yield 'undercore alias default' => [ [ 'class' => 'LBFactory_Simple' ], Wikimedia\Rdbms\LBFactorySimple::class, diff --git a/tests/phpunit/unit/includes/libs/GhostFieldAccessTraitTest.php b/tests/phpunit/unit/includes/libs/GhostFieldAccessTraitTest.php index 7e56bad070ec..06807a21ca0f 100644 --- a/tests/phpunit/unit/includes/libs/GhostFieldAccessTraitTest.php +++ b/tests/phpunit/unit/includes/libs/GhostFieldAccessTraitTest.php @@ -12,7 +12,7 @@ use Wikimedia\Tests\SerializationTestUtils; */ class GhostFieldAccessTraitTest extends MediaWikiUnitTestCase { - private function provideUnserializedInstances( string $testCaseName ) { + private static function provideUnserializedInstances( string $testCaseName ) { // Not using the trait since we only need deserialization tests. $serializationTestUtils = new SerializationTestUtils( __DIR__ . '/../../../data/GhostFieldAccess', diff --git a/tests/phpunit/unit/includes/libs/ParamValidator/TypeDef/TimestampDefTest.php b/tests/phpunit/unit/includes/libs/ParamValidator/TypeDef/TimestampDefTest.php index ef5f39653bfc..4b49b8e9d905 100644 --- a/tests/phpunit/unit/includes/libs/ParamValidator/TypeDef/TimestampDefTest.php +++ b/tests/phpunit/unit/includes/libs/ParamValidator/TypeDef/TimestampDefTest.php @@ -27,7 +27,7 @@ class TimestampDefTest extends TypeDefTestCase { $this->getInstance( new SimpleCallbacks( [] ), $options ); } - public function provideConstructorOptions(): array { + public static function provideConstructorOptions(): array { return [ 'Basic test' => [ [], true ], 'Default format ConvertibleTimestamp' => [ [ 'defaultFormat' => 'ConvertibleTimestamp' ], true ], diff --git a/tests/phpunit/unit/includes/libs/objectcache/WANObjectCacheTest.php b/tests/phpunit/unit/includes/libs/objectcache/WANObjectCacheTest.php index d0cf276897f7..6ec23021d62b 100644 --- a/tests/phpunit/unit/includes/libs/objectcache/WANObjectCacheTest.php +++ b/tests/phpunit/unit/includes/libs/objectcache/WANObjectCacheTest.php @@ -1403,7 +1403,7 @@ class WANObjectCacheTest extends MediaWikiUnitTestCase { $this->assertSame( 3, $calls, 'Callback was not used; used interim' ); } - public function getBusyValues_Provider() { + public static function getBusyValues_Provider() { $hash = new HashBagOStuff( [] ); return [ diff --git a/tests/phpunit/unit/includes/libs/rdbms/ChronologyProtectorTest.php b/tests/phpunit/unit/includes/libs/rdbms/ChronologyProtectorTest.php index 2aa418d22dfb..47be9ae4804b 100644 --- a/tests/phpunit/unit/includes/libs/rdbms/ChronologyProtectorTest.php +++ b/tests/phpunit/unit/includes/libs/rdbms/ChronologyProtectorTest.php @@ -42,7 +42,7 @@ class ChronologyProtectorTest extends PHPUnit\Framework\TestCase { $this->assertEquals( $expectedId, $cp->getClientId() ); } - public function clientIdProvider() { + public static function clientIdProvider() { return [ [ [ diff --git a/tests/phpunit/unit/includes/objectcache/MemcachedBagOStuffTest.php b/tests/phpunit/unit/includes/objectcache/MemcachedBagOStuffTest.php index de8026ff32f3..4f2b850a08cf 100644 --- a/tests/phpunit/unit/includes/objectcache/MemcachedBagOStuffTest.php +++ b/tests/phpunit/unit/includes/objectcache/MemcachedBagOStuffTest.php @@ -73,7 +73,7 @@ class MemcachedBagOStuffTest extends \MediaWikiUnitTestCase { $this->assertSame( $key, $this->cache->validateKeyEncoding( $key ) ); } - public function validKeyProvider() { + public static function validKeyProvider() { return [ 'empty' => [ '' ], 'digits' => [ '09' ], @@ -90,7 +90,7 @@ class MemcachedBagOStuffTest extends \MediaWikiUnitTestCase { $this->cache->validateKeyEncoding( $key ); } - public function invalidKeyProvider() { + public static function invalidKeyProvider() { return [ [ "\x00" ], [ ' ' ], diff --git a/tests/phpunit/unit/includes/objectcache/RedisBagOStuffTest.php b/tests/phpunit/unit/includes/objectcache/RedisBagOStuffTest.php index b3dc776464da..346ab3dc2b22 100644 --- a/tests/phpunit/unit/includes/objectcache/RedisBagOStuffTest.php +++ b/tests/phpunit/unit/includes/objectcache/RedisBagOStuffTest.php @@ -26,7 +26,7 @@ class RedisBagOStuffTest extends MediaWikiUnitTestCase { $this->assertSame( $expected, $actual, $message ); } - public function unserializeProvider() { + public static function unserializeProvider() { return [ [ -1, diff --git a/tests/phpunit/unit/includes/page/PageIdentityValueTest.php b/tests/phpunit/unit/includes/page/PageIdentityValueTest.php index 7672c377f34d..f1d7b88eac7a 100644 --- a/tests/phpunit/unit/includes/page/PageIdentityValueTest.php +++ b/tests/phpunit/unit/includes/page/PageIdentityValueTest.php @@ -31,7 +31,7 @@ use Wikimedia\Assert\PreconditionException; */ class PageIdentityValueTest extends MediaWikiUnitTestCase { - public function goodConstructorProvider() { + public static function goodConstructorProvider() { return [ [ 0, NS_MAIN, 'Test', false ], [ 7, NS_MAIN, 'Test', false ], @@ -76,7 +76,7 @@ class PageIdentityValueTest extends MediaWikiUnitTestCase { $pageIdentity->getId(); } - public function badConstructorProvider() { + public static function badConstructorProvider() { return [ [ -1, NS_MAIN, 'Test', false ], [ 0, NS_MAIN, 'Test', 2.3 ], diff --git a/tests/phpunit/unit/includes/page/PageReferenceValueTest.php b/tests/phpunit/unit/includes/page/PageReferenceValueTest.php index 103cffe4dec3..01366c0ae26c 100644 --- a/tests/phpunit/unit/includes/page/PageReferenceValueTest.php +++ b/tests/phpunit/unit/includes/page/PageReferenceValueTest.php @@ -30,7 +30,7 @@ use Wikimedia\Assert\ParameterAssertionException; */ class PageReferenceValueTest extends MediaWikiUnitTestCase { - public function goodConstructorProvider() { + public static function goodConstructorProvider() { return [ [ NS_MAIN, 'Test', false ], [ NS_MAIN, 'Test', false ], @@ -51,7 +51,7 @@ class PageReferenceValueTest extends MediaWikiUnitTestCase { $this->assertSame( $dbKey, $pageReference->getDBkey() ); } - public function badConstructorProvider() { + public static function badConstructorProvider() { return [ [ NS_MAIN, 'Test', 2.3 ], ]; diff --git a/tests/phpunit/unit/includes/page/PageStoreRecordTest.php b/tests/phpunit/unit/includes/page/PageStoreRecordTest.php index 1caa9d5090eb..3be94b5544c0 100644 --- a/tests/phpunit/unit/includes/page/PageStoreRecordTest.php +++ b/tests/phpunit/unit/includes/page/PageStoreRecordTest.php @@ -37,7 +37,7 @@ use Wikimedia\Assert\ParameterAssertionException; */ class PageStoreRecordTest extends MediaWikiUnitTestCase { - public function goodConstructorProvider() { + public static function goodConstructorProvider() { return [ 'local' => [ (object)[ @@ -106,7 +106,7 @@ class PageStoreRecordTest extends MediaWikiUnitTestCase { } } - public function badConstructorProvider() { + public static function badConstructorProvider() { $row = [ 'page_id' => 1, 'page_namespace' => NS_MAIN, diff --git a/tests/phpunit/unit/includes/site/MediaWikiPageNameNormalizerTest.php b/tests/phpunit/unit/includes/site/MediaWikiPageNameNormalizerTest.php index cb81d8930a7d..c08325178fa6 100644 --- a/tests/phpunit/unit/includes/site/MediaWikiPageNameNormalizerTest.php +++ b/tests/phpunit/unit/includes/site/MediaWikiPageNameNormalizerTest.php @@ -46,7 +46,7 @@ class MediaWikiPageNameNormalizerTest extends MediaWikiUnitTestCase { ); } - public function normalizePageTitleProvider() { + public static function normalizePageTitleProvider() { // Response are taken from wikidata and kkwiki using the following API request // api.php?action=query&prop=info&redirects=1&converttitles=1&format=json&titles=… return [ diff --git a/tests/phpunit/unit/includes/tidy/RemexDriverTest.php b/tests/phpunit/unit/includes/tidy/RemexDriverTest.php index 0cd39137fdcd..a23f22c8cd7d 100644 --- a/tests/phpunit/unit/includes/tidy/RemexDriverTest.php +++ b/tests/phpunit/unit/includes/tidy/RemexDriverTest.php @@ -309,7 +309,7 @@ class RemexDriverTest extends MediaWikiUnitTestCase { ], ]; - public function provider() { + public static function provider() { $testMathML = <<<'MathML' <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> @@ -357,7 +357,7 @@ MathML; $this->assertEquals( $expected, $result, $desc ); } - public function html5libProvider() { + public static function html5libProvider() { $files = json_decode( file_get_contents( __DIR__ . '/html5lib-tests.json' ), true ); $tests = []; foreach ( $files as $file => $fileTests ) { diff --git a/tests/phpunit/unit/includes/title/ForeignTitleTest.php b/tests/phpunit/unit/includes/title/ForeignTitleTest.php index 8fcc63f1655d..b77993e93e2f 100644 --- a/tests/phpunit/unit/includes/title/ForeignTitleTest.php +++ b/tests/phpunit/unit/includes/title/ForeignTitleTest.php @@ -26,7 +26,7 @@ */ class ForeignTitleTest extends \MediaWikiUnitTestCase { - public function basicProvider() { + public static function basicProvider() { return [ [ new ForeignTitle( 20, 'Contributor', 'JohnDoe' ), @@ -73,7 +73,7 @@ class ForeignTitleTest extends \MediaWikiUnitTestCase { $title->getNamespaceId(); } - public function fullTextProvider() { + public static function fullTextProvider() { return [ [ new ForeignTitle( 20, 'Contributor', 'JohnDoe' ), diff --git a/tests/phpunit/unit/includes/title/NaiveForeignTitleFactoryTest.php b/tests/phpunit/unit/includes/title/NaiveForeignTitleFactoryTest.php index fe367300f9d3..0072dbc468d3 100644 --- a/tests/phpunit/unit/includes/title/NaiveForeignTitleFactoryTest.php +++ b/tests/phpunit/unit/includes/title/NaiveForeignTitleFactoryTest.php @@ -26,7 +26,7 @@ */ class NaiveForeignTitleFactoryTest extends MediaWikiUnitTestCase { - public function basicProvider() { + public static function basicProvider() { return [ [ 'MainNamespaceArticle', 0, diff --git a/tests/phpunit/unit/includes/title/NamespaceAwareForeignTitleFactoryTest.php b/tests/phpunit/unit/includes/title/NamespaceAwareForeignTitleFactoryTest.php index d77797314b70..84736c1bdf51 100644 --- a/tests/phpunit/unit/includes/title/NamespaceAwareForeignTitleFactoryTest.php +++ b/tests/phpunit/unit/includes/title/NamespaceAwareForeignTitleFactoryTest.php @@ -26,7 +26,7 @@ */ class NamespaceAwareForeignTitleFactoryTest extends \MediaWikiUnitTestCase { - public function basicProvider() { + public static function basicProvider() { return [ [ 'MainNamespaceArticle', 0, diff --git a/tests/phpunit/unit/includes/title/TitleValueTest.php b/tests/phpunit/unit/includes/title/TitleValueTest.php index 20fa9e6516c4..ce0e7bd401d3 100644 --- a/tests/phpunit/unit/includes/title/TitleValueTest.php +++ b/tests/phpunit/unit/includes/title/TitleValueTest.php @@ -31,7 +31,7 @@ use MediaWiki\Title\Title; */ class TitleValueTest extends \MediaWikiUnitTestCase { - public function goodConstructorProvider() { + public static function goodConstructorProvider() { return [ [ NS_MAIN, '', 'fragment', '', true, false ], [ NS_MAIN, '', '', 'interwiki', false, true ], @@ -88,7 +88,7 @@ class TitleValueTest extends \MediaWikiUnitTestCase { $this->assertTrue( true ); // we are just checking that no exception is thrown } - public function badConstructorNamespaceTypeProvider() { + public static function badConstructorNamespaceTypeProvider() { return [ [ 'foo', 'title', 'fragment', '' ], [ null, 'title', 'fragment', '' ], @@ -96,7 +96,7 @@ class TitleValueTest extends \MediaWikiUnitTestCase { ]; } - public function badConstructorProvider() { + public static function badConstructorProvider() { return [ [ NS_MAIN, 5, 'fragment', '' ], [ NS_MAIN, null, 'fragment', '' ], @@ -148,7 +148,7 @@ class TitleValueTest extends \MediaWikiUnitTestCase { TitleValue::assertValidSpec( $ns, $text, $fragment, $interwiki ); } - public function fragmentTitleProvider() { + public static function fragmentTitleProvider() { return [ [ new TitleValue( NS_MAIN, 'Test' ), 'foo' ], [ new TitleValue( NS_TALK, 'Test', 'foo' ), '' ], @@ -220,7 +220,7 @@ class TitleValueTest extends \MediaWikiUnitTestCase { $this->assertNull( TitleValue::castPageToLinkTarget( null ) ); } - public function getTextProvider() { + public static function getTextProvider() { return [ [ 'Foo', 'Foo' ], [ 'Foo_Bar', 'Foo Bar' ], diff --git a/tests/phpunit/unit/includes/watcheditem/WatchedItemQueryServiceUnitTest.php b/tests/phpunit/unit/includes/watcheditem/WatchedItemQueryServiceUnitTest.php index f1da71ad35a1..c590b082b1c7 100644 --- a/tests/phpunit/unit/includes/watcheditem/WatchedItemQueryServiceUnitTest.php +++ b/tests/phpunit/unit/includes/watcheditem/WatchedItemQueryServiceUnitTest.php @@ -451,7 +451,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiUnitTestCase { $this->assertEquals( [ '20160203123456', 42 ], $startFrom ); } - public function getWatchedItemsWithRecentChangeInfoOptionsProvider() { + public static function getWatchedItemsWithRecentChangeInfoOptionsProvider() { return [ [ [ 'includeFields' => [ WatchedItemQueryService::INCLUDE_FLAGS ] ], @@ -857,7 +857,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiUnitTestCase { $this->assertNull( $startFrom ); } - public function filterPatrolledOptionProvider() { + public static function filterPatrolledOptionProvider() { return [ 'Patrolled' => [ WatchedItemQueryService::FILTER_PATROLLED ], 'Not patrolled' => [ WatchedItemQueryService::FILTER_NOT_PATROLLED ], @@ -894,7 +894,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiUnitTestCase { $this->assertSame( [], $items ); } - public function mysqlIndexOptimizationProvider() { + public static function mysqlIndexOptimizationProvider() { return [ [ 'mysql', @@ -953,7 +953,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiUnitTestCase { $this->assertSame( [], $items ); } - public function userPermissionRelatedExtraChecksProvider() { + public static function userPermissionRelatedExtraChecksProvider() { return [ [ [], @@ -1555,7 +1555,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiUnitTestCase { $this->assertSame( [], $items ); } - public function getWatchedItemsForUserInvalidOptionsProvider() { + public static function getWatchedItemsForUserInvalidOptionsProvider() { return [ [ [ 'sort' => 'foo' ], |