-
-
Notifications
You must be signed in to change notification settings - Fork 825
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Processor to determine the phone_type_id & im_provider_id
What we are doing here is actually very simple - despite the code being kinda insane - we are just getting the fields from the database for each column in the mapping. The fields are all loaded into the processor already & those functions are tested. This switches to using them and to passing around less variables... Follow ons will do the same for other fields (website_type_id, location_type_id but I will add more tests as I do that
- Loading branch information
1 parent
7b1b7f8
commit cd41fa5
Showing
4 changed files
with
15 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -344,10 +344,10 @@ public function testGenderLabel() { | |
public function testPrefixLabel() { | ||
$this->callAPISuccess('OptionValue', 'create', ['option_group_id' => 'individual_prefix', 'name' => 'new_one', 'label' => 'special', 'value' => 70]); | ||
$mapping = [ | ||
['name' => 'first_name', 'column_number' => 1], | ||
['name' => 'last_name', 'column_number' => 2], | ||
['name' => 'email', 'column_number' => 3, 'location_type_id' => CRM_Core_PseudoConstant::getKey('CRM_Core_BAO_Email', 'location_type_id', 'Home')], | ||
['name' => 'prefix_id', 'column_number' => 5], | ||
['name' => 'first_name', 'column_number' => 0], | ||
['name' => 'last_name', 'column_number' => 1], | ||
['name' => 'email', 'column_number' => 2, 'location_type_id' => CRM_Core_PseudoConstant::getKey('CRM_Core_BAO_Email', 'location_type_id', 'Home')], | ||
['name' => 'prefix_id', 'column_number' => 3], | ||
['name' => 'suffix_id', 'column_number' => 4], | ||
]; | ||
$processor = new CRM_Import_ImportProcessor(); | ||
|
@@ -359,12 +359,13 @@ public function testPrefixLabel() { | |
'Bill', | ||
'Gates', | ||
'[email protected]', | ||
'III', | ||
'special', | ||
'III', | ||
]; | ||
$importer->import(CRM_Import_Parser::DUPLICATE_NOCHECK, $contactValues); | ||
|
||
$contact = $this->callAPISuccessGetSingle('Contact', ['first_name' => 'Bill', 'prefix_id' => 'new_one', 'suffix_id' => 'III']); | ||
$this->assertEquals('special Bill Gates III', $contact['display_name']); | ||
} | ||
|
||
/** | ||
|