Merge pull request #1226 from kurund/CRM-11137
[civicrm-core.git] / api / v3 / examples / DomainCreate.php
CommitLineData
6a488035
TO
1<?php
2
3/*
4
5 */
6function domain_create_example(){
791c263c 7$params = array(
6a488035
TO
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 */
23function domain_create_expectedresult(){
24
791c263c 25 $expectedResult = array(
6a488035
TO
26 'is_error' => 0,
27 'version' => 3,
28 'count' => 1,
29 'id' => 3,
791c263c 30 'values' => array(
31 '3' => array(
6a488035
TO
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*/