3 * Test Generated example of using profile apply API.
9 function profile_apply_example() {
13 'first_name' => 'abc2',
14 'last_name' => 'xyz2',
15 'email-Primary' => 'abc2.xyz2@gmail.com',
16 'phone-1-1' => '022 321 826',
17 'country-1' => '1013',
18 'state_province-1' => '1000',
22 $result = civicrm_api3('profile', 'apply', $params);
24 catch (CiviCRM_API3_Exception
$e) {
26 $errorMessage = $e->getMessage();
27 $errorCode = $e->getErrorCode();
28 $errorData = $e->getExtraParams();
30 'error' => $errorMessage,
31 'error_code' => $errorCode,
32 'error_data' => $errorData,
40 * Function returns array of result expected from previous function.
45 function profile_apply_expectedresult() {
47 $expectedResult = array(
52 'contact_type' => 'Individual',
53 'contact_sub_type' => '',
58 'first_name' => 'abc2',
59 'last_name' => 'xyz2',
62 'location_type_id' => '1',
64 'email' => 'abc2.xyz2@gmail.com',
69 'location_type_id' => '1',
71 'phone_type_id' => '1',
72 'phone' => '022 321 826',
77 'location_type_id' => '1',
79 'country_id' => '1013',
80 'state_province_id' => '1000',
86 return $expectedResult;
90 * This example has been generated from the API test suite.
91 * The test that created it is called
94 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ProfileTest.php
96 * You can see the outcome of the API tests at
97 * https://test.civicrm.org/job/CiviCRM-master-git/
99 * To Learn about the API read
100 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
102 * Browse the api on your own site with the api explorer
103 * http://MYSITE.ORG/path/to/civicrm/api
105 * Read more about testing here
106 * http://wiki.civicrm.org/confluence/display/CRM/Testing
108 * API Standards documentation:
109 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards