3 * Test Generated example of using activity_type create API
6 function activity_type_create_example(){
9 'label' => 'send out letters',
17 $result = civicrm_api3('activity_type', 'create', $params);
19 catch (CiviCRM_API3_Exception
$e) {
21 $errorMessage = $e->getMessage();
22 $errorCode = $e->getErrorCode();
23 $errorData = $e->getExtraParams();
24 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
31 * Function returns array of result expected from previous function
33 function activity_type_create_expectedresult(){
35 $expectedResult = array(
43 'option_group_id' => '2',
44 'label' => 'send out letters',
46 'name' => 'send out letters',
57 'visibility_id' => '',
62 return $expectedResult;
67 * This example has been generated from the API test suite. The test that created it is called
69 * testActivityTypeCreate and can be found in
70 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ActivityTypeTest.php
72 * You can see the outcome of the API tests at
73 * http://tests.dev.civicrm.org/trunk/results-api_v3
75 * To Learn about the API read
76 * http://book.civicrm.org/developer/current/techniques/api/
78 * and review the wiki at
79 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
81 * Read more about testing here
82 * http://wiki.civicrm.org/confluence/display/CRM/Testing
84 * API Standards documentation:
85 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards