df3d7f8b4a1b49ee812815aa4e1e41fdd71e497d
[civicrm-core.git] / api / v3 / examples / Pledge / GetFilterHighDate.php
1 <?php
2
3 /*
4 demonstrates high date filter
5 */
6 function pledge_get_example(){
7 $params = array(
8 'version' => 3,
9 'pledge_start_date_high' => '20130620090530',
10 );
11
12 $result = civicrm_api( 'pledge','get',$params );
13
14 return $result;
15 }
16
17 /*
18 * Function returns array of result expected from previous function
19 */
20 function pledge_get_expectedresult(){
21
22 $expectedResult = array(
23 'is_error' => 0,
24 'version' => 3,
25 'count' => 1,
26 'id' => 2,
27 'values' => array(
28 '2' => array(
29 'contact_id' => '8',
30 'contact_type' => 'Individual',
31 'contact_sub_type' => '',
32 'sort_name' => 'Anderson, Anthony',
33 'display_name' => 'Mr. Anthony Anderson II',
34 'pledge_id' => '2',
35 'pledge_amount' => '100.00',
36 'pledge_create_date' => '2013-06-22 00:00:00',
37 'pledge_status' => 'Overdue',
38 'pledge_total_paid' => '',
39 'pledge_next_pay_date' => '2012-03-02 00:00:00',
40 'pledge_next_pay_amount' => '20.00',
41 'pledge_outstanding_amount' => '20.00',
42 'pledge_financial_type' => 'Donation',
43 'pledge_contribution_page_id' => '',
44 'pledge_frequency_interval' => '5',
45 'pledge_frequency_unit' => 'year',
46 'pledge_is_test' => 0,
47 'pledge_campaign_id' => '',
48 'pledge_currency' => 'USD',
49 'id' => '2',
50 ),
51 ),
52 );
53
54 return $expectedResult ;
55 }
56
57
58 /*
59 * This example has been generated from the API test suite. The test that created it is called
60 *
61 * testPledgeGetReturnFilters and can be found in
62 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/PledgeTest.php
63 *
64 * You can see the outcome of the API tests at
65 * http://tests.dev.civicrm.org/trunk/results-api_v3
66 *
67 * To Learn about the API read
68 * http://book.civicrm.org/developer/current/techniques/api/
69 *
70 * and review the wiki at
71 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
72 *
73 * Read more about testing here
74 * http://wiki.civicrm.org/confluence/display/CRM/Testing
75 *
76 * API Standards documentation:
77 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
78 */