4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using contribution_page get API.
15 function contribution_page_get_example() {
19 'financial_type_id' => 1,
23 $result = civicrm_api3('contribution_page', 'get', $params);
25 catch (CiviCRM_API3_Exception
$e) {
27 $errorMessage = $e->getMessage();
28 $errorCode = $e->getErrorCode();
29 $errorData = $e->getExtraParams();
31 'error' => $errorMessage,
32 'error_code' => $errorCode,
33 'error_data' => $errorData,
41 * Function returns array of result expected from previous function.
46 function contribution_page_get_expectedresult() {
48 $expectedResult = array(
56 'title' => 'Test Contribution Page',
57 'financial_type_id' => '1',
58 'is_credit_card_only' => 0,
61 'is_confirm_enabled' => '1',
62 'is_recur_interval' => 0,
63 'is_recur_installments' => 0,
64 'is_pay_later' => '1',
65 'is_partial_payment' => 0,
66 'is_allow_other_amount' => 0,
67 'goal_amount' => '34567.00',
68 'is_for_organization' => 0,
69 'is_email_receipt' => 0,
71 'amount_block_is_active' => '1',
74 'is_billing_required' => 0,
79 return $expectedResult;
83 * This example has been generated from the API test suite.
84 * The test that created it is called
85 * testGetContributionPageByAmount
87 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionPageTest.php
89 * You can see the outcome of the API tests at
90 * https://test.civicrm.org/job/CiviCRM-master-git/
92 * To Learn about the API read
93 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
95 * Browse the api on your own site with the api explorer
96 * http://MYSITE.ORG/path/to/civicrm/api/explorer
98 * Read more about testing here
99 * http://wiki.civicrm.org/confluence/display/CRM/Testing
101 * API Standards documentation:
102 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards