Merge remote-tracking branch 'upstream/4.3' into 4.3-master-2013-07-14-22-39-05
[civicrm-core.git] / api / v3 / examples / DomainCreate.php
1 <?php
2
3 /*
4
5 */
6 function domain_create_example(){
7 $params = array(
8 'name' => 'A-team domain',
9 'description' => 'domain of chaos',
10 'version' => 3,
11 'domain_version' => '4.2',
12 'contact_id' => 6,
13 );
14
15 $result = civicrm_api( 'domain','create',$params );
16
17 return $result;
18 }
19
20 /*
21 * Function returns array of result expected from previous function
22 */
23 function domain_create_expectedresult(){
24
25 $expectedResult = array(
26 'is_error' => 0,
27 'version' => 3,
28 'count' => 1,
29 'id' => 3,
30 'values' => array(
31 '3' => array(
32 'id' => '3',
33 'name' => 'A-team domain',
34 'description' => 'domain of chaos',
35 'config_backend' => '',
36 'version' => '4.2',
37 'contact_id' => '6',
38 'locales' => '',
39 'locale_custom_strings' => '',
40 ),
41 ),
42 );
43
44 return $expectedResult ;
45 }
46
47
48 /*
49 * This example has been generated from the API test suite. The test that created it is called
50 *
51 * testCreate and can be found in
52 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/DomainTest.php
53 *
54 * You can see the outcome of the API tests at
55 * http://tests.dev.civicrm.org/trunk/results-api_v3
56 *
57 * To Learn about the API read
58 * http://book.civicrm.org/developer/current/techniques/api/
59 *
60 * and review the wiki at
61 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
62 *
63 * Read more about testing here
64 * http://wiki.civicrm.org/confluence/display/CRM/Testing
65 *
66 * API Standards documentation:
67 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
68 */