registration: Refactor validation logic to avoid duplication
authorKunal Mehta <legoktm@member.fsf.org>
Thu, 1 Dec 2016 07:04:27 +0000 (23:04 -0800)
committerKunal Mehta <legoktm@member.fsf.org>
Thu, 1 Dec 2016 07:04:27 +0000 (23:04 -0800)
commitda68c0ae8256e357ff9a532c434a07788128d759
tree2493fe15a8275989f96667c000afada954254bd1
parentebc1345990182e6eba6a95a8d2c43dc32ab41ad0
registration: Refactor validation logic to avoid duplication

Previously, logic to validate extension.json files was in two places:
validateRegistrationFile.php maintenance script, and the
ExtensionJsonValidationTest.php structure test. This caused duplication
as validation became more complex (e.g. usage of spdx-licenses library).

A generic ExtensionJsonValidator class now handles most of the
validation work, while the maintenance script and test case just wrap
around it for their output formats.

Change-Id: I47062a4ae19c58ee1b1f2bb4877913259bf19c8b
autoload.php
includes/registration/ExtensionJsonValidationError.php [new file with mode: 0644]
includes/registration/ExtensionJsonValidator.php [new file with mode: 0644]
maintenance/validateRegistrationFile.php
tests/phpunit/structure/ExtensionJsonValidationTest.php