Page MenuHomePhabricator

Make ApiStructureTest work with ParamValidator
Closed, ResolvedPublic

Description

ApiStructureTest has a lot of logic for validating the settings arrays in PHPUnit. Some of that logic remains specific to the Action API, but a decent part of it should now be part of the ParamValidator library.

My current thinking is to add a "validateSettings()" method parallel to normalizeSettings(), which will will return a MessageValue[1] if validation fails. ApiStructureTest would call this and fail with the appropriate message.

[1]: Or an array of MessageValues? Or make a Message-library version of Status/StatusValue?

Event Timeline

Change 565685 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] Move some validation logic from ApiStructureTest to ParamValidator

https://gerrit.wikimedia.org/r/565685

Change 565685 merged by jenkins-bot:
[mediawiki/core@master] Move some validation logic from ApiStructureTest to ParamValidator

https://gerrit.wikimedia.org/r/565685