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 'postal_code-1' => '90210',
42 'state_province-1' => '1021',
43 'country-1' => '1228',
44 'phone-1-1' => '021 512 755',
45 'email-Primary' => 'abc1.xyz1@yahoo.com',
46 'last_name' => 'xyz1',
47 'first_name' => 'abc1',
48 'email-primary' => 'abc1.xyz1@yahoo.com',
51 'first_name' => 'abc1',
52 'last_name' => 'xyz1',
53 'street_address-1' => '5 Saint Helier St',
54 'city-1' => 'Gotham City',
55 'postal_code-1' => '90210',
56 'country-1' => '1228',
57 'state_province-1' => '1021',
60 'billing_first_name' => 'abc1',
61 'billing_middle_name' => 'J.',
62 'billing_last_name' => 'xyz1',
63 'billing_street_address-5' => '5 Saint Helier St',
64 'billing_city-5' => 'Gotham City',
65 'billing_state_province_id-5' => '1021',
66 'billing_country_id-5' => '1228',
67 'billing_postal_code-5' => '90210',
68 'billing-email-5' => 'abc1.xyz1@yahoo.com',
69 'email-5' => 'abc1.xyz1@yahoo.com',
74 return $expectedResult;
79 * This example has been generated from the API test suite. The test that created it is called
81 * testProfileGetMultiple and can be found in
82 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ProfileTest.php
84 * You can see the outcome of the API tests at
85 * http://tests.dev.civicrm.org/trunk/results-api_v3
87 * To Learn about the API read
88 * http://book.civicrm.org/developer/current/techniques/api/
90 * and review the wiki at
91 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
93 * Read more about testing here
94 * http://wiki.civicrm.org/confluence/display/CRM/Testing
96 * API Standards documentation:
97 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards