From: Kunal Mehta Date: Sun, 3 May 2015 06:02:22 +0000 (-0700) Subject: registration: Add support for $wgParserTestFiles X-Git-Tag: 1.31.0-rc.0~11508^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=2b81c4ca36936cc38c0d815cb233c50df694a87c;p=lhc%2Fweb%2Fwiklou.git registration: Add support for $wgParserTestFiles Bug: T97921 Change-Id: I9a736a4c0ff739c4acf742b8f17792544851b28e --- diff --git a/docs/extension.schema.json b/docs/extension.schema.json index b52369f892..8e8b23b63e 100644 --- a/docs/extension.schema.json +++ b/docs/extension.schema.json @@ -636,6 +636,10 @@ "config": { "type": "object", "description": "Configuration options for this extension" + }, + "ParserTestFiles": { + "type": "array", + "description": "Parser test suite files to be run by parserTests.php when no specific filename is passed to it" } } } diff --git a/includes/registration/ExtensionProcessor.php b/includes/registration/ExtensionProcessor.php index 561e798fe3..4b9a7546a0 100644 --- a/includes/registration/ExtensionProcessor.php +++ b/includes/registration/ExtensionProcessor.php @@ -24,7 +24,6 @@ class ExtensionProcessor implements Processor { 'ContentHandlers', 'ConfigRegistry', 'RateLimits', - 'ParserTestFiles', 'RecentChangesFlags', 'MediaHandlers', 'ExtensionFunctions', @@ -123,6 +122,7 @@ class ExtensionProcessor implements Processor { $this->extractMessagesDirs( $dir, $info ); $this->extractNamespaces( $info ); $this->extractResourceLoaderModules( $dir, $info ); + $this->extractParserTestFiles( $dir, $info ); if ( isset( $info['callback'] ) ) { $this->callbacks[] = $info['callback']; $this->processed[] = 'callback'; @@ -270,6 +270,15 @@ class ExtensionProcessor implements Processor { } } + protected function extractParserTestFiles( $dir, array $info ) { + if ( isset( $info['ParserTestFiles'] ) ) { + foreach ( $info['ParserTestFiles'] as $path ) { + $this->globals['wgParserTestFiles'][] = "$dir/$path"; + } + $this->processed[] = 'ParserTestFiles'; + } + } + /** * @param string $name * @param mixed $value diff --git a/maintenance/convertExtensionToRegistration.php b/maintenance/convertExtensionToRegistration.php index 78b4e8c128..06370e92de 100644 --- a/maintenance/convertExtensionToRegistration.php +++ b/maintenance/convertExtensionToRegistration.php @@ -13,6 +13,7 @@ class ConvertExtensionToRegistration extends Maintenance { 'ResourceModuleSkinStyles' => 'handleResourceModules', 'Hooks' => 'handleHooks', 'ExtensionFunctions' => 'handleExtensionFunctions', + 'ParserTestFiles' => 'removeAbsolutePath', ); /**