58120fefd2d195e0b43c516bbd7704be169873e1
3 * Test Generated example demonstrating the Contact.get API.
8 function contact_get_example() {
10 'email' => 'man2@yahoo.com',
14 $result = civicrm_api3('Contact', 'get', $params);
16 catch (CiviCRM_API3_Exception
$e) {
18 $errorMessage = $e->getMessage();
19 $errorCode = $e->getErrorCode();
20 $errorData = $e->getExtraParams();
23 'error_message' => $errorMessage,
24 'error_code' => $errorCode,
25 'error_data' => $errorData,
33 * Function returns array of result expected from previous function.
38 function contact_get_expectedresult() {
40 $expectedResult = array(
48 'contact_type' => 'Individual',
49 'contact_sub_type' => '',
50 'sort_name' => 'man2@yahoo.com',
51 'display_name' => 'man2@yahoo.com',
58 'legal_identifier' => '',
59 'external_identifier' => '',
63 'preferred_communication_method' => '',
64 'preferred_language' => 'en_US',
65 'preferred_mail_format' => 'Both',
72 'communication_style_id' => '',
77 'deceased_date' => '',
78 'household_name' => '',
79 'organization_name' => '',
81 'contact_is_deleted' => 0,
82 'current_employer' => '',
84 'street_address' => '',
85 'supplemental_address_1' => '',
86 'supplemental_address_2' => '',
87 'supplemental_address_3' => '',
89 'postal_code_suffix' => '',
93 'state_province_id' => '',
96 'phone_type_id' => '',
99 'email' => 'man2@yahoo.com',
104 'worldregion_id' => '',
105 'world_region' => '',
106 'languages' => 'English (United States)',
107 'individual_prefix' => '',
108 'individual_suffix' => '',
109 'communication_style' => '',
111 'state_province_name' => '',
112 'state_province' => '',
119 return $expectedResult;
123 * This example has been generated from the API test suite.
124 * The test that created it is called "testContactGetEmail"
125 * and can be found at:
126 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
128 * You can see the outcome of the API tests at
129 * https://test.civicrm.org/job/CiviCRM-master-git/
131 * To Learn about the API read
132 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
134 * Browse the api on your own site with the api explorer
135 * http://MYSITE.ORG/path/to/civicrm/api
137 * Read more about testing here
138 * http://wiki.civicrm.org/confluence/display/CRM/Testing
140 * API Standards documentation:
141 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards