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