diff options
author | Tim Starling <tstarling@wikimedia.org> | 2023-03-23 22:36:19 +1100 |
---|---|---|
committer | Krinkle <krinkle@fastmail.com> | 2023-03-24 02:53:57 +0000 |
commit | 5e30a927bc2d4027a660a3f7f34315a93bb06215 (patch) | |
tree | 5927c6b0a51ed6a5f44062c4b0a183c149170061 /tests/phpunit/includes/api/query | |
parent | 5ee6384bdf1f62e49ad6c2df600755be6bf1e815 (diff) | |
download | mediawikicore-5e30a927bc2d4027a660a3f7f34315a93bb06215.tar.gz mediawikicore-5e30a927bc2d4027a660a3f7f34315a93bb06215.zip |
tests: Make some PHPUnit data providers static
Just methods where adding "static" to the declaration was enough, I
didn't do anything with providers that used $this.
Initially by search and replace. There were many mistakes which I
found mostly by running the PHPStorm inspection which searches for
$this usage in a static method. Later I used the PHPStorm "make static"
action which avoids the more obvious mistakes.
Bug: T332865
Change-Id: I47ed6692945607dfa5c139d42edbd934fa4f3a36
Diffstat (limited to 'tests/phpunit/includes/api/query')
4 files changed, 4 insertions, 4 deletions
diff --git a/tests/phpunit/includes/api/query/ApiQueryBlockInfoTraitTest.php b/tests/phpunit/includes/api/query/ApiQueryBlockInfoTraitTest.php index 52c489b4772b..dbe22c122f8b 100644 --- a/tests/phpunit/includes/api/query/ApiQueryBlockInfoTraitTest.php +++ b/tests/phpunit/includes/api/query/ApiQueryBlockInfoTraitTest.php @@ -44,7 +44,7 @@ class ApiQueryBlockInfoTraitTest extends MediaWikiIntegrationTestCase { $this->assertEquals( $expect, $data ); } - public function provideAddBlockInfoToQuery() { + public static function provideAddBlockInfoToQuery() { $queryInfo = DatabaseBlock::getQueryInfo(); $db = wfGetDB( DB_REPLICA ); diff --git a/tests/phpunit/includes/api/query/ApiQueryLanguageinfoTest.php b/tests/phpunit/includes/api/query/ApiQueryLanguageinfoTest.php index f0f75a95269c..ba779e040c35 100644 --- a/tests/phpunit/includes/api/query/ApiQueryLanguageinfoTest.php +++ b/tests/phpunit/includes/api/query/ApiQueryLanguageinfoTest.php @@ -43,7 +43,7 @@ class ApiQueryLanguageinfoTest extends ApiTestCase { return [ $res[0]['query']['languageinfo'], $res[0]['continue'] ?? null ]; } - public function provideTestAllPropsForSingleLanguage() { + public static function provideTestAllPropsForSingleLanguage() { yield [ 'sr', [ diff --git a/tests/phpunit/includes/api/query/ApiQueryRevisionsTest.php b/tests/phpunit/includes/api/query/ApiQueryRevisionsTest.php index 5914d6a00c46..3f05adada9ef 100644 --- a/tests/phpunit/includes/api/query/ApiQueryRevisionsTest.php +++ b/tests/phpunit/includes/api/query/ApiQueryRevisionsTest.php @@ -131,7 +131,7 @@ class ApiQueryRevisionsTest extends ApiTestCase { ); } - public function provideSectionNewTestCases() { + public static function provideSectionNewTestCases() { yield 'page with existing section' => [ "==A section==\ntext", '' diff --git a/tests/phpunit/includes/api/query/ApiQueryTest.php b/tests/phpunit/includes/api/query/ApiQueryTest.php index 8b699ed3a031..f9e896df3857 100644 --- a/tests/phpunit/includes/api/query/ApiQueryTest.php +++ b/tests/phpunit/includes/api/query/ApiQueryTest.php @@ -114,7 +114,7 @@ class ApiQueryTest extends ApiTestCase { 'ApiUsageException thrown by titlePartToKey' ); } - public function provideTestTitlePartToKey() { + public static function provideTestTitlePartToKey() { return [ [ 'a b c', NS_MAIN, 'A_b_c', false ], [ 'x', NS_MAIN, 'X', false ], |