3 * Test Generated example of using profile get API
6 function profile_get_example(){
17 $result = civicrm_api3('profile', 'get', $params);
19 catch (CiviCRM_API3_Exception
$e) {
21 $errorMessage = $e->getMessage();
22 $errorCode = $e->getErrorCode();
23 $errorData = $e->getExtraParams();
24 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
31 * Function returns array of result expected from previous function
33 function profile_get_expectedresult(){
35 $expectedResult = array(
41 'first_name' => 'abc1',
42 'last_name' => 'xyz1',
43 'email-Primary' => 'abc1.xyz1@yahoo.com',
44 'phone-1-1' => '021 512 755',
45 'country-1' => '1228',
46 'state_province-1' => '1021',
47 'postal_code-1' => '90210',
50 'first_name' => 'abc1',
51 'last_name' => 'xyz1',
52 'street_address-1' => '5 Saint Helier St',
53 'city-1' => 'Gotham City',
54 'postal_code-1' => '90210',
55 'country-1' => '1228',
56 'state_province-1' => '1021',
59 'billing_first_name' => 'abc1',
60 'billing_middle_name' => 'J.',
61 'billing_last_name' => 'xyz1',
62 'billing_street_address-5' => '5 Saint Helier St',
63 'billing_city-5' => 'Gotham City',
64 'billing_state_province_id-5' => '1021',
65 'billing_country_id-5' => '1228',
66 'billing_postal_code-5' => '90210',
67 'billing-email-5' => 'abc1.xyz1@yahoo.com',
68 'email-5' => 'abc1.xyz1@yahoo.com',
73 return $expectedResult;
78 * This example has been generated from the API test suite. The test that created it is called
80 * testProfileGetMultiple and can be found in
81 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ProfileTest.php
83 * You can see the outcome of the API tests at
84 * http://tests.dev.civicrm.org/trunk/results-api_v3
86 * To Learn about the API read
87 * http://book.civicrm.org/developer/current/techniques/api/
89 * and review the wiki at
90 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
92 * Read more about testing here
93 * http://wiki.civicrm.org/confluence/display/CRM/Testing
95 * API Standards documentation:
96 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards