Merge remote-tracking branch 'upstream/4.3' into 4.3-master-2013-07-14-22-39-05
[civicrm-core.git] / api / v3 / examples / ContributionPageGet.php
1 <?php
2
3 /*
4
5 */
6 function contribution_page_get_example(){
7 $params = array(
8 'version' => 3,
9 'amount' => '34567',
10 'currency' => 'NZD',
11 'financial_type_id' => 1,
12 );
13
14 $result = civicrm_api( 'contribution_page','get',$params );
15
16 return $result;
17 }
18
19 /*
20 * Function returns array of result expected from previous function
21 */
22 function contribution_page_get_expectedresult(){
23
24 $expectedResult = array(
25 'is_error' => 0,
26 'version' => 3,
27 'count' => 1,
28 'id' => 3,
29 'values' => array(
30 '3' => array(
31 'id' => '3',
32 'title' => 'Test Contribution Page',
33 'financial_type_id' => '1',
34 'is_credit_card_only' => 0,
35 'is_monetary' => '1',
36 'is_recur' => 0,
37 'is_confirm_enabled' => '1',
38 'is_recur_interval' => 0,
39 'is_recur_installments' => 0,
40 'is_pay_later' => 0,
41 'is_partial_payment' => 0,
42 'is_allow_other_amount' => 0,
43 'goal_amount' => '34567.00',
44 'is_for_organization' => 0,
45 'is_email_receipt' => 0,
46 'amount_block_is_active' => '1',
47 'currency' => 'NZD',
48 'is_share' => '1',
49 ),
50 ),
51 );
52
53 return $expectedResult ;
54 }
55
56
57 /*
58 * This example has been generated from the API test suite. The test that created it is called
59 *
60 * testGetContributionPageByAmount and can be found in
61 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ContributionPageTest.php
62 *
63 * You can see the outcome of the API tests at
64 * http://tests.dev.civicrm.org/trunk/results-api_v3
65 *
66 * To Learn about the API read
67 * http://book.civicrm.org/developer/current/techniques/api/
68 *
69 * and review the wiki at
70 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
71 *
72 * Read more about testing here
73 * http://wiki.civicrm.org/confluence/display/CRM/Testing
74 *
75 * API Standards documentation:
76 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
77 */