Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ||
3 | /* | |
4 | demonstrates get + delete in the same call | |
5 | */ | |
6 | function mail_settings_get_example(){ | |
7 | $params = array( | |
8 | 'version' => 3, | |
9 | 'title' => 'MailSettings title', | |
10 | 'api.MailSettings.delete' => 1, | |
11 | ); | |
12 | ||
13 | $result = civicrm_api( 'mail_settings','get',$params ); | |
14 | ||
15 | return $result; | |
16 | } | |
17 | ||
18 | /* | |
19 | * Function returns array of result expected from previous function | |
20 | */ | |
21 | function mail_settings_get_expectedresult(){ | |
22 | ||
23 | $expectedResult = array( | |
24 | 'is_error' => 0, | |
25 | 'version' => 3, | |
26 | 'count' => 2, | |
27 | 'values' => array( | |
28 | '1' => array( | |
29 | 'id' => '1', | |
30 | 'domain_id' => '1', | |
31 | 'name' => 'default', | |
32 | 'is_default' => '1', | |
33 | 'domain' => 'EXAMPLE.ORG', | |
34 | 'api.MailSettings.delete' => array( | |
35 | 'is_error' => 0, | |
36 | 'version' => 3, | |
37 | 'count' => 1, | |
38 | 'values' => 1, | |
39 | ), | |
40 | ), | |
41 | '3' => array( | |
42 | 'id' => '3', | |
43 | 'domain_id' => '1', | |
44 | 'name' => 'my mail setting', | |
45 | 'is_default' => 0, | |
46 | 'domain' => 'setting.com', | |
47 | 'server' => 'localhost', | |
48 | 'username' => 'sue', | |
49 | 'password' => 'pass', | |
50 | 'is_ssl' => 0, | |
51 | 'api.MailSettings.delete' => array( | |
52 | 'is_error' => 0, | |
53 | 'version' => 3, | |
54 | 'count' => 1, | |
55 | 'values' => 1, | |
56 | ), | |
57 | ), | |
58 | ), | |
59 | ); | |
60 | ||
61 | return $expectedResult ; | |
62 | } | |
63 | ||
64 | ||
65 | /* | |
66 | * This example has been generated from the API test suite. The test that created it is called | |
67 | * | |
68 | * testGetMailSettingsChainDelete and can be found in | |
69 | * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/MailSettingsTest.php | |
70 | * | |
71 | * You can see the outcome of the API tests at | |
72 | * http://tests.dev.civicrm.org/trunk/results-api_v3 | |
73 | * | |
74 | * To Learn about the API read | |
75 | * http://book.civicrm.org/developer/current/techniques/api/ | |
76 | * | |
77 | * and review the wiki at | |
78 | * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs | |
79 | * | |
80 | * Read more about testing here | |
81 | * http://wiki.civicrm.org/confluence/display/CRM/Testing | |
82 | * | |
83 | * API Standards documentation: | |
84 | * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards | |
85 | */ |