63ea1d2844fdea29c15dd0ccb57d3bf5f10797d2
[civicrm-core.git] / api / v3 / examples / ActivityTypeCreate.php
1 <?php
2
3 /*
4
5 */
6 function activity_type_create_example(){
7 $params = array(
8 'weight' => '2',
9 'label' => 'send out letters',
10 'version' => 3,
11 'filter' => 0,
12 'is_active' => 1,
13 'is_optgroup' => 1,
14 'is_default' => 0,
15 );
16
17 $result = civicrm_api( 'activity_type','create',$params );
18
19 return $result;
20 }
21
22 /*
23 * Function returns array of result expected from previous function
24 */
25 function activity_type_create_expectedresult(){
26
27 $expectedResult = array(
28 'is_error' => 0,
29 'version' => 3,
30 'count' => 1,
31 'id' => 723,
32 'values' => array(
33 '723' => array(
34 'id' => '723',
35 'option_group_id' => '2',
36 'label' => 'send out letters',
37 'value' => '44',
38 'name' => 'send out letters',
39 'grouping' => '',
40 'filter' => 0,
41 'is_default' => 0,
42 'weight' => '2',
43 'description' => '',
44 'is_optgroup' => '1',
45 'is_reserved' => '',
46 'is_active' => '1',
47 'component_id' => '',
48 'domain_id' => '',
49 'visibility_id' => '',
50 ),
51 ),
52 );
53
54 return $expectedResult ;
55 }
56
57
58 /*
59 * This example has been generated from the API test suite. The test that created it is called
60 *
61 * testActivityTypeCreate and can be found in
62 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ActivityTypeTest.php
63 *
64 * You can see the outcome of the API tests at
65 * http://tests.dev.civicrm.org/trunk/results-api_v3
66 *
67 * To Learn about the API read
68 * http://book.civicrm.org/developer/current/techniques/api/
69 *
70 * and review the wiki at
71 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
72 *
73 * Read more about testing here
74 * http://wiki.civicrm.org/confluence/display/CRM/Testing
75 *
76 * API Standards documentation:
77 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
78 */