CRM-20858: Add Failing Tests to Verify Merging of Custom Fields
If a contact that has values stored in a custom group table is merged into a
contact that doesn't have a record in that table, all values in the source
target will be merged into the target contact, even if those values were
not explicity selected to the merge operation.
The merging operation updates all database references from the source contact
to the target contact on all tables. When the target contact has a record on
a custom group table, this update will fail, since the table's configuration
enforces the entity_id (the reference to the contacts table) to be unique.
However, when the target contact has no record on that custom group table, the
source contact does have a record and the merge is performed, the original
record will be updated to reference the target contact, and hence inherit ALL
values of the source contact, even if none of the values were selected to be
merged.
Added two tests, the first one to verify that merging a contact with a record
on a custom group table does not merge its values into a target contact with
no record in the custom group table; the second one to check that if only some
fields of a custom group table are selected to be merged, only those values
are copied, leaving all others unset.