aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/parser/ParserOutputTest.php
diff options
context:
space:
mode:
authorC. Scott Ananian <cscott@cscott.net>2024-05-20 22:52:58 -0400
committerC. Scott Ananian <cscott@cscott.net>2024-05-22 11:43:26 -0400
commit5d775fa1b3c6069cb89ce12464bf7933a720e313 (patch)
tree9112d6e756d3710ea0484e7d36236c9f46f7ca4f /tests/phpunit/includes/parser/ParserOutputTest.php
parentf66bda6a2ed473c77cd7e9e5b278adceaab51681 (diff)
downloadmediawikicore-5d775fa1b3c6069cb89ce12464bf7933a720e313.tar.gz
mediawikicore-5d775fa1b3c6069cb89ce12464bf7933a720e313.zip
SerializationTestTrait: make phpunit data providers static
PHPUnit 10 requires test data providers to be static. This patch doesn't completely do the job, as some providers currently call the non-static method `$this->markTestSkippedIfPhp()`, but it gets us closer to PHPUnit 10 compatibility. This also lets us simplify the validateParserCacheSerializationTestData maintenance script and make it slightly more generic. Change-Id: Ie3696bfaa29aca9da45f54239126222e8c847ea9
Diffstat (limited to 'tests/phpunit/includes/parser/ParserOutputTest.php')
-rw-r--r--tests/phpunit/includes/parser/ParserOutputTest.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/phpunit/includes/parser/ParserOutputTest.php b/tests/phpunit/includes/parser/ParserOutputTest.php
index ff2154cf6cb7..f6c6c42a5faa 100644
--- a/tests/phpunit/includes/parser/ParserOutputTest.php
+++ b/tests/phpunit/includes/parser/ParserOutputTest.php
@@ -43,7 +43,7 @@ class ParserOutputTest extends MediaWikiLangTestCase {
* Overrides SerializationTestTrait::getClassToTest
* @return string
*/
- protected function getClassToTest(): string {
+ public static function getClassToTest(): string {
return ParserOutput::class;
}
@@ -51,7 +51,7 @@ class ParserOutputTest extends MediaWikiLangTestCase {
* Overrides SerializationTestTrait::getSerializedDataPath
* @return string
*/
- protected function getSerializedDataPath(): string {
+ public static function getSerializedDataPath(): string {
return __DIR__ . '/../../data/ParserCache';
}
@@ -59,7 +59,7 @@ class ParserOutputTest extends MediaWikiLangTestCase {
* Overrides SerializationTestTrait::getTestInstancesAndAssertions
* @return array
*/
- protected function getTestInstancesAndAssertions(): array {
+ public static function getTestInstancesAndAssertions(): array {
return ParserCacheSerializationTestCases::getParserOutputTestCases();
}
@@ -67,9 +67,9 @@ class ParserOutputTest extends MediaWikiLangTestCase {
* Overrides SerializationTestTrait::getSupportedSerializationFormats
* @return array
*/
- protected function getSupportedSerializationFormats(): array {
+ public static function getSupportedSerializationFormats(): array {
return ParserCacheSerializationTestCases::getSupportedSerializationFormats(
- $this->getClassToTest() );
+ self::getClassToTest() );
}
public static function provideIsLinkInternal() {