3 * Test Generated example of using email replace API
6 function email_replace_example(){
11 'location_type_id' => 18,
12 'email' => '1-1@example.com',
16 'location_type_id' => 18,
17 'email' => '1-2@example.com',
21 'location_type_id' => 18,
22 'email' => '1-3@example.com',
26 'location_type_id' => 19,
27 'email' => '2-1@example.com',
31 'location_type_id' => 19,
32 'email' => '2-2@example.com',
39 $result = civicrm_api3('email', 'replace', $params);
41 catch (CiviCRM_API3_Exception
$e) {
43 $errorMessage = $e->getMessage();
44 $errorCode = $e->getErrorCode();
45 $errorData = $e->getExtraParams();
46 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
53 * Function returns array of result expected from previous function
55 function email_replace_expectedresult(){
57 $expectedResult = array(
65 'location_type_id' => '18',
66 'email' => '1-1@example.com',
73 'signature_text' => '',
74 'signature_html' => '',
79 'location_type_id' => '18',
80 'email' => '1-2@example.com',
87 'signature_text' => '',
88 'signature_html' => '',
93 'location_type_id' => '18',
94 'email' => '1-3@example.com',
101 'signature_text' => '',
102 'signature_html' => '',
107 'location_type_id' => '19',
108 'email' => '2-1@example.com',
115 'signature_text' => '',
116 'signature_html' => '',
121 'location_type_id' => '19',
122 'email' => '2-2@example.com',
129 'signature_text' => '',
130 'signature_html' => '',
135 return $expectedResult;
140 * This example has been generated from the API test suite. The test that created it is called
142 * testReplaceEmail and can be found in
143 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/EmailTest.php
145 * You can see the outcome of the API tests at
146 * http://tests.dev.civicrm.org/trunk/results-api_v3
148 * To Learn about the API read
149 * http://book.civicrm.org/developer/current/techniques/api/
151 * and review the wiki at
152 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
154 * Read more about testing here
155 * http://wiki.civicrm.org/confluence/display/CRM/Testing
157 * API Standards documentation:
158 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards