3 * Test Generated example of using profile apply API
6 function profile_apply_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', 'apply', $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_apply_expectedresult(){
37 $expectedResult = array(
42 'contact_type' => 'Individual',
43 'contact_sub_type' => '',
48 'first_name' => 'abc2',
49 'last_name' => 'xyz2',
52 'location_type_id' => '1',
54 'email' => 'abc2.xyz2@gmail.com',
59 'location_type_id' => '1',
61 'phone_type_id' => '1',
62 'phone' => '022 321 826',
67 'location_type_id' => '1',
69 'country_id' => '1013',
70 'state_province_id' => '1000',
76 return $expectedResult;
81 * This example has been generated from the API test suite. The test that created it is called
83 * testProfileApply and can be found in
84 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ProfileTest.php
86 * You can see the outcome of the API tests at
87 * http://tests.dev.civicrm.org/trunk/results-api_v3
89 * To Learn about the API read
90 * http://book.civicrm.org/developer/current/techniques/api/
92 * and review the wiki at
93 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
95 * Read more about testing here
96 * http://wiki.civicrm.org/confluence/display/CRM/Testing
98 * API Standards documentation:
99 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards