From 5d775fa1b3c6069cb89ce12464bf7933a720e313 Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Mon, 20 May 2024 22:52:58 -0400 Subject: 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 --- tests/phpunit/includes/parser/ParserOutputTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/phpunit/includes/parser/ParserOutputTest.php') 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() { -- cgit v1.2.3