Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ||
3 | /* | |
4 | ||
5 | */ | |
6 | function contribution_recur_get_example(){ | |
7 | $params = array( | |
8 | 'version' => 3, | |
9 | 'amount' => '500', | |
10 | ); | |
11 | ||
12 | $result = civicrm_api( 'contribution_recur','get',$params ); | |
13 | ||
14 | return $result; | |
15 | } | |
16 | ||
17 | /* | |
18 | * Function returns array of result expected from previous function | |
19 | */ | |
20 | function contribution_recur_get_expectedresult(){ | |
21 | ||
22 | $expectedResult = array( | |
23 | 'is_error' => 0, | |
24 | 'version' => 3, | |
25 | 'count' => 1, | |
26 | 'id' => 1, | |
27 | 'values' => array( | |
28 | '1' => array( | |
29 | 'id' => '1', | |
30 | 'contact_id' => '4', | |
31 | 'amount' => '500.00', | |
32 | 'currency' => 'USD', | |
33 | 'frequency_unit' => 'day', | |
34 | 'frequency_interval' => '1', | |
35 | 'installments' => '12', | |
36 | 'start_date' => '2012-01-01 00:00:00', | |
37 | 'create_date' => '2013-02-04 22:26:27', | |
38 | 'contribution_status_id' => '1', | |
39 | 'is_test' => 0, | |
40 | 'cycle_day' => '1', | |
41 | 'failure_count' => 0, | |
42 | 'auto_renew' => 0, | |
43 | 'is_email_receipt' => '1', | |
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 | * testGetContributionRecur and can be found in | |
56 | * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ContributionRecurTest.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 | */ |