aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/XmlTest.php
diff options
context:
space:
mode:
authorTim Starling <tstarling@wikimedia.org>2023-03-23 22:36:19 +1100
committerKrinkle <krinkle@fastmail.com>2023-03-24 02:53:57 +0000
commit5e30a927bc2d4027a660a3f7f34315a93bb06215 (patch)
tree5927c6b0a51ed6a5f44062c4b0a183c149170061 /tests/phpunit/includes/XmlTest.php
parent5ee6384bdf1f62e49ad6c2df600755be6bf1e815 (diff)
downloadmediawikicore-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/XmlTest.php')
-rw-r--r--tests/phpunit/includes/XmlTest.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/phpunit/includes/XmlTest.php b/tests/phpunit/includes/XmlTest.php
index 3c190d5ad5d3..880b82d8d99b 100644
--- a/tests/phpunit/includes/XmlTest.php
+++ b/tests/phpunit/includes/XmlTest.php
@@ -40,7 +40,7 @@ class XmlTest extends MediaWikiIntegrationTestCase {
$this->setUserLang( $langObj );
}
- public function provideElement() {
+ public static function provideElement() {
// $expect, $element, $attribs, $contents
yield 'Opening element with no attributes' => [ '<element>', 'element', null, null ];
yield 'Terminated empty element' => [ '<element />', 'element', null, '' ];
@@ -98,7 +98,7 @@ class XmlTest extends MediaWikiIntegrationTestCase {
$this->assertEquals( '</element>', Xml::closeElement( 'element' ), 'closeElement() shortcut' );
}
- public function provideMonthSelector() {
+ public static function provideMonthSelector() {
# providers are run before services are set up
$lang = new class() {
public function getMonthName( $i ) {
@@ -430,7 +430,7 @@ class XmlTest extends MediaWikiIntegrationTestCase {
);
}
- public function provideFieldset() {
+ public static function provideFieldset() {
// $expect, [ $arg1, $arg2, ... ]
yield 'Opening tag' => [ "<fieldset>\n", [] ];
yield 'Opening tag (false means no legend)' => [ "<fieldset>\n", [ false ] ];