Merge pull request #583 from yashodha/CRM-12463
[civicrm-core.git] / api / v3 / examples / TagCreate.php
CommitLineData
6a488035
TO
1<?php
2
3/*
4
5 */
6function tag_create_example(){
7$params = array(
8 'name' => 'New Tag3',
9 'description' => 'This is description for New Tag 02',
10 'version' => 3,
11);
12
13 $result = civicrm_api( 'tag','create',$params );
14
15 return $result;
16}
17
18/*
19 * Function returns array of result expected from previous function
20 */
21function tag_create_expectedresult(){
22
23 $expectedResult = array(
24 'is_error' => 0,
25 'version' => 3,
26 'count' => 1,
27 'id' => 8,
28 'values' => array(
29 '8' => array(
30 'id' => '8',
31 'name' => 'New Tag3',
32 'description' => 'This is description for New Tag 02',
33 'parent_id' => '',
34 'is_selectable' => '',
35 'is_reserved' => '',
36 'is_tagset' => '',
37 'used_for' => 'civicrm_contact',
38 'created_id' => '',
39 'created_date' => '20130204224540',
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/TagTest.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*/