Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ||
3 | /* | |
4 | ||
5 | */ | |
6 | function pledge_payment_get_example(){ | |
7 | $params = array( | |
8 | 'version' => 3, | |
9 | ); | |
10 | ||
11 | $result = civicrm_api( 'pledge_payment','get',$params ); | |
12 | ||
13 | return $result; | |
14 | } | |
15 | ||
16 | /* | |
17 | * Function returns array of result expected from previous function | |
18 | */ | |
19 | function pledge_payment_get_expectedresult(){ | |
20 | ||
21 | $expectedResult = array( | |
22 | 'is_error' => 0, | |
23 | 'version' => 3, | |
24 | 'count' => 5, | |
25 | 'values' => array( | |
26 | '1' => array( | |
27 | 'id' => '1', | |
28 | 'pledge_id' => '1', | |
29 | 'scheduled_amount' => '20.00', | |
30 | 'currency' => 'USD', | |
31 | 'scheduled_date' => '2013-02-15 00:00:00', | |
32 | 'reminder_count' => 0, | |
33 | 'status_id' => '2', | |
34 | ), | |
35 | '2' => array( | |
36 | 'id' => '2', | |
37 | 'pledge_id' => '1', | |
38 | 'scheduled_amount' => '20.00', | |
39 | 'currency' => 'USD', | |
40 | 'scheduled_date' => '2018-02-15 00:00:00', | |
41 | 'reminder_count' => 0, | |
42 | 'status_id' => '2', | |
43 | ), | |
44 | '3' => array( | |
45 | 'id' => '3', | |
46 | 'pledge_id' => '1', | |
47 | 'scheduled_amount' => '20.00', | |
48 | 'currency' => 'USD', | |
49 | 'scheduled_date' => '2023-02-15 00:00:00', | |
50 | 'reminder_count' => 0, | |
51 | 'status_id' => '2', | |
52 | ), | |
53 | '4' => array( | |
54 | 'id' => '4', | |
55 | 'pledge_id' => '1', | |
56 | 'scheduled_amount' => '20.00', | |
57 | 'currency' => 'USD', | |
58 | 'scheduled_date' => '2028-02-15 00:00:00', | |
59 | 'reminder_count' => 0, | |
60 | 'status_id' => '2', | |
61 | ), | |
62 | '5' => array( | |
63 | 'id' => '5', | |
64 | 'pledge_id' => '1', | |
65 | 'scheduled_amount' => '20.00', | |
66 | 'currency' => 'USD', | |
67 | 'scheduled_date' => '2033-02-15 00:00:00', | |
68 | 'reminder_count' => 0, | |
69 | 'status_id' => '2', | |
70 | ), | |
71 | ), | |
72 | ); | |
73 | ||
74 | return $expectedResult ; | |
75 | } | |
76 | ||
77 | ||
78 | /* | |
79 | * This example has been generated from the API test suite. The test that created it is called | |
80 | * | |
81 | * testGetPledgePayment and can be found in | |
82 | * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/PledgePaymentTest.php | |
83 | * | |
84 | * You can see the outcome of the API tests at | |
85 | * http://tests.dev.civicrm.org/trunk/results-api_v3 | |
86 | * | |
87 | * To Learn about the API read | |
88 | * http://book.civicrm.org/developer/current/techniques/api/ | |
89 | * | |
90 | * and review the wiki at | |
91 | * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs | |
92 | * | |
93 | * Read more about testing here | |
94 | * http://wiki.civicrm.org/confluence/display/CRM/Testing | |
95 | * | |
96 | * API Standards documentation: | |
97 | * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards | |
98 | */ |