3 * Test Generated example of using activity get API.
5 * Get with Contact Ref Custom Field
10 function activity_get_example() {
12 'return.custom_2' => 1,
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' => 'test activity type id',
52 'activity_date_time' => '2011-06-02 14:36:13',
54 'location' => 'Pennsylvania',
55 'details' => 'a test activity',
60 'is_current_revision' => '1',
62 'source_contact_id' => '1',
63 'custom_1' => 'defaultValue',
64 'custom_1_1' => 'defaultValue',
65 'custom_2' => 'Anderson, Anthony',
66 'custom_2_1' => 'Anderson, Anthony',
67 'custom_2_1_id' => '1',
73 return $expectedResult;
77 * This example has been generated from the API test suite.
78 * The test that created it is called
79 * testActivityCreateCustomContactRefField
81 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
83 * You can see the outcome of the API tests at
84 * https://test.civicrm.org/job/CiviCRM-master-git/
86 * To Learn about the API read
87 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
89 * Browse the api on your own site with the api explorer
90 * http://MYSITE.ORG/path/to/civicrm/api
92 * Read more about testing here
93 * http://wiki.civicrm.org/confluence/display/CRM/Testing
95 * API Standards documentation:
96 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards