X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FconvertExtensionToRegistration.php;h=6c1edc2ba01b8966438996cf3c76eafd5ddb933c;hb=7f6bd0c6fec48474f2225bd26979815c0229813d;hp=4ae95587030b64ae04cba34a93af653b6536175d;hpb=51e40a712f2f2eb57216b26a16c91d14f74d5cf2;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/convertExtensionToRegistration.php b/maintenance/convertExtensionToRegistration.php index 4ae9558703..6c1edc2ba0 100644 --- a/maintenance/convertExtensionToRegistration.php +++ b/maintenance/convertExtensionToRegistration.php @@ -13,7 +13,7 @@ class ConvertExtensionToRegistration extends Maintenance { 'ResourceModuleSkinStyles' => 'handleResourceModules', 'Hooks' => 'handleHooks', 'ExtensionFunctions' => 'handleExtensionFunctions', - 'ParserTestFiles' => 'removeAbsolutePath', + 'ParserTestFiles' => 'removeAutodiscoveredParserTestFiles', ]; /** @@ -222,6 +222,22 @@ class ConvertExtensionToRegistration extends Maintenance { $this->json[$realName] = $out; } + protected function removeAutodiscoveredParserTestFiles( $realName, $value ) { + $out = []; + foreach ( $value as $key => $val ) { + $path = $this->stripPath( $val, $this->dir ); + // When path starts with tests/parser/ the file would be autodiscovered with + // extension registry, so no need to add it to extension.json + if ( substr( $path, 0, 13 ) !== 'tests/parser/' || substr( $path, -4 ) !== '.txt' ) { + $out[$key] = $path; + } + } + // in the best case all entries are filtered out + if ( $out ) { + $this->json[$realName] = $out; + } + } + protected function handleCredits( $realName, $value ) { $keys = array_keys( $value ); $this->json['type'] = $keys[0];