registration: Deprecate ParserTestFiles in extension.json
authorKunal Mehta <legoktm@member.fsf.org>
Mon, 3 Jun 2019 01:33:24 +0000 (21:33 -0400)
committerKunal Mehta <legoktm@member.fsf.org>
Mon, 3 Jun 2019 01:53:31 +0000 (21:53 -0400)
Warnings will be emitted whenever validation is checked or unit tests are
run.

Bug: T192154
Change-Id: Ib968f696890667841d850ef5562e05989cb4f431

docs/extension.schema.v1.json
docs/extension.schema.v2.json
includes/registration/ExtensionJsonValidator.php

index cf02f2b..86fa1b3 100644 (file)
                },
                "ParserTestFiles": {
                        "type": "array",
-                       "description": "Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
+                       "description": "DEPRECATED: Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
                },
                "ServiceWiringFiles": {
                        "type": "array",
index f29f850..6076581 100644 (file)
                },
                "ParserTestFiles": {
                        "type": "array",
-                       "description": "Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
+                       "description": "DEPRECATED: Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
                },
                "ServiceWiringFiles": {
                        "type": "array",
index ba5df52..0d95b22 100644 (file)
@@ -141,6 +141,12 @@ class ExtensionJsonValidator {
                        }
                }
 
+               // Deprecated stuff
+               if ( isset( $data->ParserTestFiles ) ) {
+                       // phpcs:ignore Generic.Files.LineLength.TooLong
+                       $extraErrors[] = '[ParserTestFiles] DEPRECATED: see <https://www.mediawiki.org/wiki/Manual:Extension.json/Schema#ParserTestFiles>';
+               }
+
                $validator = new Validator;
                $validator->check( $data, (object)[ '$ref' => 'file://' . $schemaPath ] );
                if ( $validator->isValid() && !$extraErrors ) {