2c1e69bbab5491243ba035ad2e32dfc9b6d47313
3 * Test Generated example demonstrating the MailSettings.get API.
5 * Demonstrates get + delete in the same call.
10 function mail_settings_get_example() {
12 'title' => 'MailSettings title',
13 'api.MailSettings.delete' => 1,
17 $result = civicrm_api3('MailSettings', 'get', $params);
19 catch (CiviCRM_API3_Exception
$e) {
21 $errorMessage = $e->getMessage();
22 $errorCode = $e->getErrorCode();
23 $errorData = $e->getExtraParams();
25 'error' => $errorMessage,
26 'error_code' => $errorCode,
27 'error_data' => $errorData,
35 * Function returns array of result expected from previous function.
40 function mail_settings_get_expectedresult() {
42 $expectedResult = array(
52 'domain' => 'EXAMPLE.ORG',
53 'api.MailSettings.delete' => array(
63 'name' => 'my mail setting',
65 'domain' => 'setting.com',
66 'server' => 'localhost',
70 'api.MailSettings.delete' => array(
80 return $expectedResult;
84 * This example has been generated from the API test suite.
85 * The test that created it is called "testGetMailSettingsChainDelete"
86 * and can be found at:
87 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailSettingsTest.php
89 * You can see the outcome of the API tests at
90 * https://test.civicrm.org/job/CiviCRM-master-git/
92 * To Learn about the API read
93 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
95 * Browse the api on your own site with the api explorer
96 * http://MYSITE.ORG/path/to/civicrm/api
98 * Read more about testing here
99 * http://wiki.civicrm.org/confluence/display/CRM/Testing
101 * API Standards documentation:
102 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards