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