Skip to content
Snippets Groups Projects
Commit 972dc9a7 authored by colemanw's avatar colemanw
Browse files

Api3 - Delete old Profile API function (deprecated since 2014)

parent fe23695a
Branches
Tags
No related merge requests found
......@@ -312,23 +312,6 @@ function _civicrm_api3_profile_submit_spec(&$params, $apirequest) {
}
}
/**
* Update Profile field values.
*
* @deprecated - calling this function directly is deprecated as 'set' is not a clear action
* use submit
*
* @param array $params
* Array of property name/value.
* pairs to update profile field values
*
* @return array
* Updated Contact/ Activity object|CRM_Error
*/
function civicrm_api3_profile_set($params) {
return civicrm_api3('profile', 'submit', $params);
}
/**
* Apply profile.
*
......@@ -758,7 +741,6 @@ function _civicrm_api3_profile_appendaliases($values, $entity) {
*/
function _civicrm_api3_profile_deprecation() {
return [
'set' => 'Profile api "set" action is deprecated in favor of "submit".',
'apply' => 'Profile api "apply" action is deprecated in favor of "submit".',
];
}
......@@ -518,41 +518,6 @@ class api_v3_ProfileTest extends CiviUnitTestCase {
]);
}
/**
* Set is deprecated but we need to ensure it still works.
*/
public function testLegacySet(): void {
$profileFieldValues = $this->createIndividualContact();
$contactId = key($profileFieldValues);
$updateParams = [
'first_name' => 'abc2',
'last_name' => 'xyz2',
'email-Primary' => 'abc2.xyz2@gmail.com',
'phone-1-1' => '022 321 826',
'country-1' => '1013',
'state_province-1' => '1000',
];
$params = array_merge([
'profile_id' => $this->_profileID,
'contact_id' => $contactId,
], $updateParams);
$result = $this->callAPISuccess('profile', 'set', $params);
$this->assertArrayKeyExists('values', $result);
$getParams = [
'profile_id' => $this->_profileID,
'contact_id' => $contactId,
];
$profileDetails = $this->callAPISuccess('profile', 'get', $getParams);
foreach ($updateParams as $profileField => $value) {
$this->assertEquals($value, $profileDetails['values'][$profileField], 'In line ' . __LINE__ . ' error message: ' . "missing/mismatching value for $profileField"
);
}
}
/**
* Check contact activity profile without activity id.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment