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 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/MailSettingsTest.php
79 * You can see the outcome of the API tests at
80 * http://tests.dev.civicrm.org/trunk/results-api_v3
82 * To Learn about the API read
83 * http://book.civicrm.org/developer/current/techniques/api/
85 * and review the wiki at
86 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
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