4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using contribution_soft create API.
15 function contribution_soft_create_example() {
17 'contribution_id' => 6,
21 'soft_credit_type_id' => 5,
25 $result = civicrm_api3('contribution_soft', 'create', $params);
27 catch (CiviCRM_API3_Exception
$e) {
29 $errorMessage = $e->getMessage();
30 $errorCode = $e->getErrorCode();
31 $errorData = $e->getExtraParams();
33 'error' => $errorMessage,
34 'error_code' => $errorCode,
35 'error_data' => $errorData,
43 * Function returns array of result expected from previous function.
48 function contribution_soft_create_expectedresult() {
50 $expectedResult = array(
58 'contribution_id' => '6',
63 'pcp_display_in_roll' => '',
64 'pcp_roll_nickname' => '',
65 'pcp_personal_note' => '',
66 'soft_credit_type_id' => '5',
71 return $expectedResult;
75 * This example has been generated from the API test suite.
76 * The test that created it is called
77 * testCreateContributionSoft
79 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionSoftTest.php
81 * You can see the outcome of the API tests at
82 * https://test.civicrm.org/job/CiviCRM-master-git/
84 * To Learn about the API read
85 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
87 * Browse the api on your own site with the api explorer
88 * http://MYSITE.ORG/path/to/civicrm/api/explorer
90 * Read more about testing here
91 * http://wiki.civicrm.org/confluence/display/CRM/Testing
93 * API Standards documentation:
94 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards