diff --git a/extension.json b/extension.json index afe8d9b1..6fee7f43 100644 --- a/extension.json +++ b/extension.json @@ -20,9 +20,6 @@ "RelatedArticlesMagic": "RelatedArticles.i18n.magic.php" }, "Hooks": { - "UnitTestsList": [ - "RelatedArticles\\Hooks::onUnitTestsList" - ], "ResourceLoaderTestModules": [ "RelatedArticles\\Hooks::onResourceLoaderTestModules" ], @@ -30,9 +27,6 @@ "ParserFirstCallInit": [ "RelatedArticles\\Hooks::onParserFirstCallInit" ], - "ParserClearState": [ - "RelatedArticles\\Hooks::onParserClearState" - ], "OutputPageParserOutput": [ "RelatedArticles\\Hooks::onOutputPageParserOutput" ], diff --git a/includes/Hooks.php b/includes/Hooks.php index ac8fac98..6329e0f9 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -55,27 +55,6 @@ class Hooks { return ''; } - /** - * Handler for the ParserClearState hook. - * - * Empties the internal list so that related pages are not passed on to future - * ParserOutput's - note that {{#related:Foo}} appends and can be used multiple times - * in the page. - * - * @param Parser $parser - * @return boolean Always true - */ - public static function onParserClearState( Parser &$parser ) { - $parserOutput = $parser->getOutput(); - - $parserOutput->setExtensionData( 'RelatedArticles', [] ); - - // FIXME: Remove in 30 days (T115698) - $parserOutput->unsetProperty( 'RelatedArticles' ); - - return true; - } - /** * Passes the related pages list from the cached parser output * object to the output page for rendering. @@ -97,21 +76,6 @@ class Hooks { return true; } - /** - * Handler for the UnitTestsList hook. - * - * Adds the path to this extension's PHPUnit test suite to the set of - * paths. - * - * @param array $paths - * @return boolean Always true - */ - public static function onUnitTestsList( array &$paths ) { - $paths[] = __DIR__ . '/../tests/phpunit'; - - return true; - } - /** * Register QUnit tests. * @see https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderTestModules diff --git a/tests/phpunit/HooksTest.php b/tests/phpunit/HooksTest.php deleted file mode 100644 index 2297bed4..00000000 --- a/tests/phpunit/HooksTest.php +++ /dev/null @@ -1,34 +0,0 @@ -mOutput = new ParserOutput(); - $relatedPages = [ 'Maybeshewill' ]; - - $parserOutput->setExtensionData( 'RelatedArticles', $relatedPages ); - $parserOutput->setProperty( 'RelatedArticles', $relatedPages ); - - Hooks::onParserClearState( $parser ); - - $this->assertEquals( - [], - $parserOutput->getExtensionData( 'RelatedArticles' ), - 'It clears the list of related pages.' - ); - - $this->assertEquals( - false, - $parserOutput->getProperty( 'RelatedArticles' ), - '[T115698] It unsets the list of related pages that were set as a property.' - ); - } -}