13e2d8ecd29956c7227ab1ec110471f2ae7e348c
3 * Test Generated example of using activity get API.
5 * demonstrates _low filter (at time of writing doesn't work if contact_id is set
10 function activity_get_example() {
12 'filter.activity_date_time_low' => '20120101000000',
17 $result = civicrm_api3('activity', 'get', $params);
19 catch (CiviCRM_API3_Exception
$e) {
21 $errorMessage = $e->getMessage();
22 $errorCode = $e->getErrorCode();
23 $errorData = $e->getExtraParams();
25 'error' => $errorMessage,
26 'error_code' => $errorCode,
27 'error_data' => $errorData,
35 * Function returns array of result expected from previous function.
40 function activity_get_expectedresult() {
42 $expectedResult = array(
50 'activity_type_id' => '51',
51 'subject' => 'Make-it-Happen Meeting',
52 'activity_date_time' => '2012-02-16 00:00:00',
54 'location' => 'Pennsylvania',
55 'details' => 'a test activity',
60 'is_current_revision' => '1',
62 'source_contact_id' => '1',
67 return $expectedResult;
71 * This example has been generated from the API test suite.
72 * The test that created it is called
73 * testGetFilterMaxDate
75 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
77 * You can see the outcome of the API tests at
78 * https://test.civicrm.org/job/CiviCRM-master-git/
80 * To Learn about the API read
81 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
83 * Browse the api on your own site with the api explorer
84 * http://MYSITE.ORG/path/to/civicrm/api
86 * Read more about testing here
87 * http://wiki.civicrm.org/confluence/display/CRM/Testing
89 * API Standards documentation:
90 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards