4 Function demonstrates getting asignee_contact_id & using it to get the contact
6 function activity_get_example(){
11 'return.assignee_contact_id' => 1,
12 'api.contact.get' => array(
13 'id' => '$value.source_contact_id',
17 $result = civicrm_api( 'activity','get',$params );
23 * Function returns array of result expected from previous function
25 function activity_get_expectedresult(){
27 $expectedResult = array(
35 'activity_type_id' => '44',
36 'subject' => 'test activity type id',
37 'activity_date_time' => '2011-06-02 14:36:13',
39 'location' => 'Pensulvania',
40 'details' => 'a test activity',
45 'is_current_revision' => '1',
47 'assignee_contact_id' => array(
50 'source_contact_id' => '17',
51 'api.contact.get' => array(
53 'undefined_fields' => array(
54 '0' => 'api.has_parent',
62 'contact_type' => 'Individual',
63 'contact_sub_type' => '',
65 'display_name' => 'Test Contact',
72 'legal_identifier' => '',
73 'external_identifier' => '',
77 'preferred_mail_format' => '',
78 'first_name' => 'Test',
80 'last_name' => 'Contact',
84 'deceased_date' => '',
85 'household_name' => '',
86 'organization_name' => '',
88 'contact_is_deleted' => 0,
89 'current_employer' => '',
91 'street_address' => '',
92 'supplemental_address_1' => '',
93 'supplemental_address_2' => '',
95 'postal_code_suffix' => '',
99 'state_province_id' => '',
100 'state_province_name' => '',
101 'state_province' => '',
105 'phone_type_id' => '',
113 'worldregion_id' => '',
114 'world_region' => '',
123 return $expectedResult ;
128 * This example has been generated from the API test suite. The test that created it is called
130 * testActivityGetGoodID1 and can be found in
131 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ActivityTest.php
133 * You can see the outcome of the API tests at
134 * http://tests.dev.civicrm.org/trunk/results-api_v3
136 * To Learn about the API read
137 * http://book.civicrm.org/developer/current/techniques/api/
139 * and review the wiki at
140 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
142 * Read more about testing here
143 * http://wiki.civicrm.org/confluence/display/CRM/Testing
145 * API Standards documentation:
146 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards