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