3 * Test Generated example of using activity get API.
5 * Demonstrates _high filter (at time of writing doesn't work if contact_id is set.
10 function activity_get_example() {
12 'source_contact_id' => 1,
13 'filter.activity_date_time_high' => '20120101000000',
18 $result = civicrm_api3('activity', 'get', $params);
20 catch (CiviCRM_API3_Exception
$e) {
22 $errorMessage = $e->getMessage();
23 $errorCode = $e->getErrorCode();
24 $errorData = $e->getExtraParams();
26 'error' => $errorMessage,
27 'error_code' => $errorCode,
28 'error_data' => $errorData,
36 * Function returns array of result expected from previous function.
41 function activity_get_expectedresult() {
43 $expectedResult = array(
51 'activity_type_id' => '51',
52 'subject' => 'Make-it-Happen Meeting',
53 'activity_date_time' => '2011-01-01 00:00:00',
55 'location' => 'Pennsylvania',
56 'details' => 'a test activity',
61 'is_current_revision' => '1',
63 'source_contact_id' => '1',
68 return $expectedResult;
72 * This example has been generated from the API test suite.
73 * The test that created it is called
74 * testGetFilterMaxDate
76 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
78 * You can see the outcome of the API tests at
79 * https://test.civicrm.org/job/CiviCRM-master-git/
81 * To Learn about the API read
82 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
84 * Browse the api on your own site with the api explorer
85 * http://MYSITE.ORG/path/to/civicrm/api
87 * Read more about testing here
88 * http://wiki.civicrm.org/confluence/display/CRM/Testing
90 * API Standards documentation:
91 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards