3 * Test Generated example of using profile submit API
6 function profile_submit_example(){
10 'first_name' => 'abc2',
11 'last_name' => 'xyz2',
12 'email-primary' => 'abc2.xyz2@gmail.com',
13 'phone-1-1' => '022 321 826',
14 'country-1' => '1013',
15 'state_province-1' => '1000',
19 $result = civicrm_api3('profile', 'submit', $params);
21 catch (CiviCRM_API3_Exception
$e) {
23 $errorMessage = $e->getMessage();
24 $errorCode = $e->getErrorCode();
25 $errorData = $e->getExtraParams();
26 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
33 * Function returns array of result expected from previous function
35 function profile_submit_expectedresult(){
37 $expectedResult = array(
45 'contact_type' => 'Individual',
46 'contact_sub_type' => '',
53 'legal_identifier' => '',
54 'external_identifier' => '',
55 'sort_name' => 'xyz2, abc2',
56 'display_name' => 'abc2 xyz2',
60 'preferred_communication_method' => '',
61 'preferred_language' => 'en_US',
62 'preferred_mail_format' => 'Both',
63 'hash' => '67eac7789eaee00',
65 'first_name' => 'abc2',
66 'middle_name' => 'J.',
67 'last_name' => 'xyz2',
70 'email_greeting_id' => '1',
71 'email_greeting_custom' => '',
72 'email_greeting_display' => 'Dear abc1',
73 'postal_greeting_id' => '1',
74 'postal_greeting_custom' => '',
75 'postal_greeting_display' => 'Dear abc1',
76 'addressee_id' => '1',
77 'addressee_custom' => '',
78 'addressee_display' => 'Mr. abc1 J. xyz1 II',
83 'deceased_date' => '',
84 'household_name' => '',
85 'primary_contact_id' => '',
86 'organization_name' => '',
88 'user_unique_id' => '',
89 'created_date' => '2013-07-28 08:49:19',
90 'modified_date' => '2012-11-14 16:02:35',
95 return $expectedResult;
100 * This example has been generated from the API test suite. The test that created it is called
102 * testProfileSubmit and can be found in
103 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ProfileTest.php
105 * You can see the outcome of the API tests at
106 * https://test.civicrm.org/job/CiviCRM-master-git/
108 * To Learn about the API read
109 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
111 * Browse the api on your own site with the api explorer
112 * http://MYSITE.ORG/path/to/civicrm/api/explorer
114 * Read more about testing here
115 * http://wiki.civicrm.org/confluence/display/CRM/Testing
117 * API Standards documentation:
118 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards