(REF) APIv4 ConformanceTest - Split apart into per-entity sub-tests #17845
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This updates a unit-test to make the output easier to understand.
We need more output because the test sporadically fails, and we don't know why.
ping @colemanw
Before
There is a function
testConformance()
which internally loops through a list of entities.Whenever the test fails, it aborts testing and reports one failure (for all entities) without indicating the specific entity which failed.
After
There is a test function
testConformance($entity)
which uses a data provider.Whenever the test fails, it will be logged with the entity name. Testing can resume for additional entities.
Technical Details
There are a couple technical distinctions between this revision, the previous revision, and the comparable APIv3 test:
Each test-case returned by the '@dataProvider' has a symbolic name. These are easier to skim than numeric names.
The list of entities is not based on runtime services, because that constrains how PHPUnit and Civi lifecycles interact. It uses a heuristic/low-tech listing (
getEntitiesLotech()
). In the rare case where the low-tech list is wrong, it will complain and ask for maintenance.