74654ade260be09a9bf7d2e3122adc150b262985
3 * Test Generated example demonstrating the Email.replace API.
8 function email_replace_example() {
13 'location_type_id' => 18,
14 'email' => '1-1@example.com',
18 'location_type_id' => 18,
19 'email' => '1-2@example.com',
23 'location_type_id' => 18,
24 'email' => '1-3@example.com',
28 'location_type_id' => 19,
29 'email' => '2-1@example.com',
33 'location_type_id' => 19,
34 'email' => '2-2@example.com',
41 $result = civicrm_api3('Email', 'replace', $params);
43 catch (CiviCRM_API3_Exception
$e) {
45 $errorMessage = $e->getMessage();
46 $errorCode = $e->getErrorCode();
47 $errorData = $e->getExtraParams();
49 'error' => $errorMessage,
50 'error_code' => $errorCode,
51 'error_data' => $errorData,
59 * Function returns array of result expected from previous function.
64 function email_replace_expectedresult() {
66 $expectedResult = array(
74 'location_type_id' => '18',
75 'email' => '1-1@example.com',
82 'signature_text' => '',
83 'signature_html' => '',
88 'location_type_id' => '18',
89 'email' => '1-2@example.com',
96 'signature_text' => '',
97 'signature_html' => '',
102 'location_type_id' => '18',
103 'email' => '1-3@example.com',
110 'signature_text' => '',
111 'signature_html' => '',
116 'location_type_id' => '19',
117 'email' => '2-1@example.com',
124 'signature_text' => '',
125 'signature_html' => '',
130 'location_type_id' => '19',
131 'email' => '2-2@example.com',
138 'signature_text' => '',
139 'signature_html' => '',
144 return $expectedResult;
148 * This example has been generated from the API test suite.
149 * The test that created it is called "testReplaceEmail"
150 * and can be found at:
151 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EmailTest.php
153 * You can see the outcome of the API tests at
154 * https://test.civicrm.org/job/CiviCRM-master-git/
156 * To Learn about the API read
157 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
159 * Browse the api on your own site with the api explorer
160 * http://MYSITE.ORG/path/to/civicrm/api
162 * Read more about testing here
163 * http://wiki.civicrm.org/confluence/display/CRM/Testing
165 * API Standards documentation:
166 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards