3 * Test Generated example demonstrating the Profile.apply API.
8 function profile_apply_example() {
12 'first_name' => 'abc2',
13 'last_name' => 'xyz2',
14 'email-Primary' => 'abc2.xyz2@gmail.com',
15 'phone-1-1' => '022 321 826',
16 'country-1' => '1013',
17 'state_province-1' => '1000',
21 $result = civicrm_api3('Profile', 'apply', $params);
23 catch (CiviCRM_API3_Exception
$e) {
25 $errorMessage = $e->getMessage();
26 $errorCode = $e->getErrorCode();
27 $errorData = $e->getExtraParams();
29 'error' => $errorMessage,
30 'error_code' => $errorCode,
31 'error_data' => $errorData,
39 * Function returns array of result expected from previous function.
44 function profile_apply_expectedresult() {
46 $expectedResult = array(
51 'contact_type' => 'Individual',
52 'contact_sub_type' => '',
57 'first_name' => 'abc2',
58 'last_name' => 'xyz2',
61 'location_type_id' => '1',
63 'email' => 'abc2.xyz2@gmail.com',
68 'location_type_id' => '1',
70 'phone_type_id' => '1',
71 'phone' => '022 321 826',
76 'location_type_id' => '1',
78 'country_id' => '1013',
79 'state_province_id' => '1000',
85 return $expectedResult;
89 * This example has been generated from the API test suite.
90 * The test that created it is called "testProfileApply"
91 * and can be found at:
92 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ProfileTest.php
94 * You can see the outcome of the API tests at
95 * https://test.civicrm.org/job/CiviCRM-master-git/
97 * To Learn about the API read
98 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
100 * Browse the api on your own site with the api explorer
101 * http://MYSITE.ORG/path/to/civicrm/api
103 * Read more about testing here
104 * http://wiki.civicrm.org/confluence/display/CRM/Testing
106 * API Standards documentation:
107 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards