3 * Test Generated example of using mail_settings get API
4 * demonstrates get + delete in the same call *
6 function mail_settings_get_example(){
8 'title' => 'MailSettings title',
9 'api.MailSettings.delete' => 1,
13 $result = civicrm_api3('mail_settings', 'get', $params);
15 catch (CiviCRM_API3_Exception
$e) {
17 $errorMessage = $e->getMessage();
18 $errorCode = $e->getErrorCode();
19 $errorData = $e->getExtraParams();
20 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
27 * Function returns array of result expected from previous function
29 function mail_settings_get_expectedresult(){
31 $expectedResult = array(
41 'domain' => 'EXAMPLE.ORG',
42 'api.MailSettings.delete' => array(
52 'name' => 'my mail setting',
54 'domain' => 'setting.com',
55 'server' => 'localhost',
59 'api.MailSettings.delete' => array(
69 return $expectedResult;
74 * This example has been generated from the API test suite. The test that created it is called
76 * testGetMailSettingsChainDelete and can be found in
77 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailSettingsTest.php
79 * You can see the outcome of the API tests at
80 * https://test.civicrm.org/job/CiviCRM-master-git/
82 * To Learn about the API read
83 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
85 * Browse the api on your own site with the api explorer
86 * http://MYSITE.ORG/path/to/civicrm/api/explorer
88 * Read more about testing here
89 * http://wiki.civicrm.org/confluence/display/CRM/Testing
91 * API Standards documentation:
92 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards