3 * Test Generated example of using activity API
4 * Example demonstrates setting & retrieving the target & source *
6 function activity__example(){
8 'source_contact_id' => 1,
9 'subject' => 'Make-it-Happen Meeting',
10 'activity_date_time' => '20110316',
12 'location' => 'Pensulvania',
13 'details' => 'a test activity',
15 'activity_type_id' => 1,
17 'target_contact_id' => 1,
18 'assignee_contact_id' => 1,
22 $result = civicrm_api3('activity', '', $params);
24 catch (CiviCRM_API3_Exception
$e) {
26 $errorMessage = $e->getMessage();
27 $errorCode = $e->getErrorCode();
28 $errorData = $e->getExtraParams();
29 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
36 * Function returns array of result expected from previous function
38 function activity__expectedresult(){
40 $expectedResult = array(
48 'source_record_id' => '',
49 'activity_type_id' => '1',
50 'subject' => 'Make-it-Happen Meeting',
51 'activity_date_time' => '20110316000000',
53 'location' => 'Pensulvania',
56 'details' => 'a test activity',
63 'relationship_id' => '',
64 'is_current_revision' => '',
69 'engagement_level' => '',
75 return $expectedResult;
80 * This example has been generated from the API test suite. The test that created it is called
82 * testActivityReturnTargetAssignee and can be found in
83 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
85 * You can see the outcome of the API tests at
86 * https://test.civicrm.org/job/CiviCRM-master-git/
88 * To Learn about the API read
89 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
91 * Browse the api on your own site with the api explorer
92 * http://MYSITE.ORG/path/to/civicrm/api/explorer
94 * Read more about testing here
95 * http://wiki.civicrm.org/confluence/display/CRM/Testing
97 * API Standards documentation:
98 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards