Expanding the coverage
Once your test is to your liking, it now has to cover every entity.
The simplest way to do it, is probably to iterate over the metadata cache of the associated API : cache/{api}/metadata-cache.json
Ref : https://github.com/PHPCreation/phpreaction-api-endpoints-tests/blob/main/cache/PHPR/metadata-cache.json
Script vs Contract/Factory pattern
You can make Contract/Factory style for reusability between API, or Script style for single API.
For Contract/Factory example, see : https://github.com/PHPCreation/phpreaction-api-endpoints-tests/blob/main/tests/lib/nested-object-contract.suite.js
For Script style example, see : https://github.com/PHPCreation/phpreaction-api-endpoints-tests/blob/main/tests/PHPR/show.test.js
Last updated on