Merge pull request #1048 from eileenmcnaughton/master
[civicrm-core.git] / api / v3 / examples / PledgeGet.php
1 <?php
2
3 /*
4
5 */
6 function pledge_get_example(){
7 $params = array(
8 'pledge_id' => 1,
9 'version' => 3,
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' => 1,
27 'values' => array(
28 '1' => array(
29 'contact_id' => '5',
30 'contact_type' => 'Individual',
31 'contact_sub_type' => '',
32 'sort_name' => 'Anderson, Anthony',
33 'display_name' => 'Mr. Anthony Anderson II',
34 'pledge_id' => '1',
35 'pledge_amount' => '100.00',
36 'pledge_create_date' => '2013-06-22 00:00:00',
37 'pledge_status' => 'Pending',
38 'pledge_total_paid' => '',
39 'pledge_next_pay_date' => '2013-06-24 00:00:00',
40 'pledge_next_pay_amount' => '20.00',
41 'pledge_outstanding_amount' => '',
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' => '1',
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 * testGetPledge 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 */