4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using activity API.
11 * Example demonstrates setting & retrieving the target & source
16 function activity__example() {
18 'source_contact_id' => 1,
19 'subject' => 'Make-it-Happen Meeting',
20 'activity_date_time' => '20110316',
22 'location' => 'Pensulvania',
23 'details' => 'a test activity',
25 'activity_type_id' => 1,
27 'target_contact_id' => 1,
28 'assignee_contact_id' => 1,
32 $result = civicrm_api3('activity', '', $params);
34 catch (CiviCRM_API3_Exception
$e) {
36 $errorMessage = $e->getMessage();
37 $errorCode = $e->getErrorCode();
38 $errorData = $e->getExtraParams();
40 'error' => $errorMessage,
41 'error_code' => $errorCode,
42 'error_data' => $errorData,
50 * Function returns array of result expected from previous function.
55 function activity__expectedresult() {
57 $expectedResult = array(
65 'source_record_id' => '',
66 'activity_type_id' => '1',
67 'subject' => 'Make-it-Happen Meeting',
68 'activity_date_time' => '20110316000000',
70 'location' => 'Pensulvania',
73 'details' => 'a test activity',
80 'relationship_id' => '',
81 'is_current_revision' => '',
86 'engagement_level' => '',
92 return $expectedResult;
96 * This example has been generated from the API test suite.
97 * The test that created it is called
98 * testActivityReturnTargetAssignee
100 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
102 * You can see the outcome of the API tests at
103 * https://test.civicrm.org/job/CiviCRM-master-git/
105 * To Learn about the API read
106 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
108 * Browse the api on your own site with the api explorer
109 * http://MYSITE.ORG/path/to/civicrm/api/explorer
111 * Read more about testing here
112 * http://wiki.civicrm.org/confluence/display/CRM/Testing
114 * API Standards documentation:
115 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards