[NFC] Add ImportProcessor class & unit tests + extend existing cover #15072
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
Adds a bunch of helpers which will allow us to massively cleanup loadSavedMapping and add test cover. This change is NFC of itself as it does not start to USE the new helpers as yet. The goal is to bring in the usage alongside tests of the live code
Before
Currently to get the value for 'type' the code looks like
After
we can replace the above with
Similar applies to all the other hard-to-read code. We are really just doing a fairly simple mapping conversion & it doesn't need to be so hard.
Also the CRM_Core_BAO_Mapping::getMappingFields function will be close to obsolete once this has been adopted
Technical Details
This adds the full ImportProcessor class from the WIP pr #15034 - minus the functions that
replace loadSavedMapping) along with tests. It does NOT start to use the new class as yet.
Comments
Note that #15068 will need rebasing if this is merged first & vice versa
The goal is to bring this class into use along with extending tests but this is 'safe' in that no functional code is changed