forked from civicrm/civicrm-core
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request civicrm#19886 from eileenmcnaughton/import
Fix for importing preferred language (and other fields) by label
- Loading branch information
Showing
5 changed files
with
46 additions
and
16 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 |
---|---|---|
|
@@ -454,7 +454,7 @@ public function testGenderLabel() { | |
* @throws \CRM_Core_Exception | ||
* @throws \CiviCRM_API3_Exception | ||
*/ | ||
public function testPrefixLabel() { | ||
public function testPrefixLabel(): void { | ||
$this->callAPISuccess('OptionValue', 'create', ['option_group_id' => 'individual_prefix', 'name' => 'new_one', 'label' => 'special', 'value' => 70]); | ||
$mapping = [ | ||
['name' => 'first_name', 'column_number' => 0], | ||
|
@@ -484,9 +484,11 @@ public function testPrefixLabel() { | |
/** | ||
* Test that labels work for importing custom data. | ||
* | ||
* @throws \API_Exception | ||
* @throws \CRM_Core_Exception | ||
* @throws \CiviCRM_API3_Exception | ||
*/ | ||
public function testCustomDataLabel() { | ||
public function testCustomDataLabel(): void { | ||
$this->createCustomGroupWithFieldOfType([], 'select'); | ||
$contactValues = [ | ||
'first_name' => 'Bill', | ||
|
@@ -519,6 +521,22 @@ public function testCustomDataName() { | |
$this->assertEquals('Y', $contact[$this->getCustomFieldName('select')]); | ||
} | ||
|
||
/** | ||
* Test importing in the Preferred Language Field | ||
* | ||
* @throws \CRM_Core_Exception | ||
*/ | ||
public function testPreferredLanguageImport() { | ||
$contactValues = [ | ||
'first_name' => 'Bill', | ||
'last_name' => 'Gates', | ||
'email' => '[email protected]', | ||
'nick_name' => 'Billy-boy', | ||
'preferred_language' => 'English (Australia)', | ||
]; | ||
$this->runImport($contactValues, CRM_Import_Parser::DUPLICATE_UPDATE, CRM_Import_Parser::VALID, [NULL, NULL, 'Primary', NULL, NULL]); | ||
} | ||
|
||
/** | ||
* Test that the import parser adds the address to the primary location. | ||
* | ||
|
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