3 * Test Generated example of using tag create API
6 function tag_create_example(){
8 'name' => 'Super Heros',
9 'description' => 'Outside undie-wearers',
13 $result = civicrm_api3('tag', 'create', $params);
15 catch (CiviCRM_API3_Exception
$e) {
17 $errorMessage = $e->getMessage();
18 $errorCode = $e->getErrorCode();
19 $errorData = $e->getExtraParams();
20 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
27 * Function returns array of result expected from previous function
29 function tag_create_expectedresult(){
31 $expectedResult = array(
39 'name' => 'Super Heros',
40 'description' => 'Outside undie-wearers',
42 'is_selectable' => '',
45 'used_for' => 'civicrm_contact',
47 'created_date' => '2013-07-28 08:49:19',
52 return $expectedResult;
57 * This example has been generated from the API test suite. The test that created it is called
59 * testCreate and can be found in
60 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TagTest.php
62 * You can see the outcome of the API tests at
63 * https://test.civicrm.org/job/CiviCRM-master-git/
65 * To Learn about the API read
66 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
68 * Browse the api on your own site with the api explorer
69 * http://MYSITE.ORG/path/to/civicrm/api/explorer
71 * Read more about testing here
72 * http://wiki.civicrm.org/confluence/display/CRM/Testing
74 * API Standards documentation:
75 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards