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