3 * Test Generated example of using email replace API.
9 function email_replace_example() {
14 'location_type_id' => 18,
15 'email' => '1-1@example.com',
19 'location_type_id' => 18,
20 'email' => '1-2@example.com',
24 'location_type_id' => 18,
25 'email' => '1-3@example.com',
29 'location_type_id' => 19,
30 'email' => '2-1@example.com',
34 'location_type_id' => 19,
35 'email' => '2-2@example.com',
42 $result = civicrm_api3('email', 'replace', $params);
44 catch (CiviCRM_API3_Exception
$e) {
46 $errorMessage = $e->getMessage();
47 $errorCode = $e->getErrorCode();
48 $errorData = $e->getExtraParams();
50 'error' => $errorMessage,
51 'error_code' => $errorCode,
52 'error_data' => $errorData,
60 * Function returns array of result expected from previous function.
65 function email_replace_expectedresult() {
67 $expectedResult = array(
75 'location_type_id' => '18',
76 'email' => '1-1@example.com',
83 'signature_text' => '',
84 'signature_html' => '',
89 'location_type_id' => '18',
90 'email' => '1-2@example.com',
97 'signature_text' => '',
98 'signature_html' => '',
103 'location_type_id' => '18',
104 'email' => '1-3@example.com',
111 'signature_text' => '',
112 'signature_html' => '',
117 'location_type_id' => '19',
118 'email' => '2-1@example.com',
125 'signature_text' => '',
126 'signature_html' => '',
131 'location_type_id' => '19',
132 'email' => '2-2@example.com',
139 'signature_text' => '',
140 'signature_html' => '',
145 return $expectedResult;
149 * This example has been generated from the API test suite.
150 * The test that created it is called
152 * and can be found in
153 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EmailTest.php
155 * You can see the outcome of the API tests at
156 * https://test.civicrm.org/job/CiviCRM-master-git/
158 * To Learn about the API read
159 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
161 * Browse the api on your own site with the api explorer
162 * http://MYSITE.ORG/path/to/civicrm/api
164 * Read more about testing here
165 * http://wiki.civicrm.org/confluence/display/CRM/Testing
167 * API Standards documentation:
168 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards