Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ||
3 | /* | |
4 | demonstrates _high filter (at time of writing doesn't work if contact_id is set | |
5 | */ | |
6 | function activity_get_example(){ | |
feb2a730 | 7 | $params = array( |
6a488035 TO |
8 | 'source_contact_id' => 17, |
9 | 'version' => 3, | |
10 | 'filter.activity_date_time_high' => '20120101000000', | |
11 | 'sequential' => 1, | |
12 | ); | |
13 | ||
14 | $result = civicrm_api( 'activity','get',$params ); | |
15 | ||
16 | return $result; | |
17 | } | |
18 | ||
19 | /* | |
20 | * Function returns array of result expected from previous function | |
21 | */ | |
22 | function activity_get_expectedresult(){ | |
23 | ||
feb2a730 | 24 | $expectedResult = array( |
6a488035 TO |
25 | 'is_error' => 0, |
26 | 'version' => 3, | |
27 | 'count' => 1, | |
28 | 'id' => 1, | |
feb2a730 | 29 | 'values' => array( |
30 | '0' => array( | |
6a488035 | 31 | 'id' => '1', |
6a488035 TO |
32 | 'activity_type_id' => '44', |
33 | 'subject' => 'Make-it-Happen Meeting', | |
34 | 'activity_date_time' => '2011-01-01 00:00:00', | |
35 | 'duration' => '120', | |
36 | 'location' => 'Pensulvania', | |
37 | 'details' => 'a test activity', | |
38 | 'status_id' => '1', | |
39 | 'priority_id' => '1', | |
40 | 'is_test' => 0, | |
41 | 'is_auto' => 0, | |
42 | 'is_current_revision' => '1', | |
43 | 'is_deleted' => 0, | |
70f7ba9e | 44 | 'source_contact_id' => '17', |
6a488035 TO |
45 | ), |
46 | ), | |
47 | ); | |
48 | ||
49 | return $expectedResult ; | |
50 | } | |
51 | ||
52 | ||
53 | /* | |
54 | * This example has been generated from the API test suite. The test that created it is called | |
55 | * | |
56 | * testGetFilterMaxDate and can be found in | |
57 | * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ActivityTest.php | |
58 | * | |
59 | * You can see the outcome of the API tests at | |
60 | * http://tests.dev.civicrm.org/trunk/results-api_v3 | |
61 | * | |
62 | * To Learn about the API read | |
63 | * http://book.civicrm.org/developer/current/techniques/api/ | |
64 | * | |
65 | * and review the wiki at | |
66 | * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs | |
67 | * | |
68 | * Read more about testing here | |
69 | * http://wiki.civicrm.org/confluence/display/CRM/Testing | |
70 | * | |
71 | * API Standards documentation: | |
72 | * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards | |
73 | */ |