}
}
+ /**
+ * set is deprecated but we need to ensure it still works
+ */
+ function testLegacySet() {
+ $pofileFieldValues = $this->_createIndividualContact();
+ current($pofileFieldValues);
+ $contactId = key($pofileFieldValues);
+
+ $updateParams = array(
+ '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(array(
+ 'profile_id' => 25,
+ 'contact_id' => $contactId,
+ ), $updateParams);
+
+ $result = $this->callAPISuccess('profile', 'set', $params);
+ $this->assertArrayKeyExists('values', $result);
+ $getParams = array(
+ 'profile_id' => 25,
+ 'contact_id' => $contactId,
+ );
+ $profileDetails = $this->callAPISuccess('profile', 'get', $getParams);
+
+ foreach ($updateParams as $profileField => $value) {
+ $this->assertEquals($value, CRM_Utils_Array::value($profileField, $profileDetails['values']), "In line " . __LINE__ . " error message: " . "missing/mismatching value for {$profileField}"
+ );
+ }
+ }
/*
* check contact activity profile without activity id
*/