4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using price_field_value create API.
15 function price_field_value_create_example() {
17 'price_field_id' => 13,
18 'membership_type_id' => 5,
20 'label' => 'memType1',
22 'membership_num_terms' => 2,
24 'financial_type_id' => 2,
28 $result = civicrm_api3('price_field_value', 'create', $params);
30 catch (CiviCRM_API3_Exception
$e) {
32 $errorMessage = $e->getMessage();
33 $errorCode = $e->getErrorCode();
34 $errorData = $e->getExtraParams();
36 'error' => $errorMessage,
37 'error_code' => $errorCode,
38 'error_data' => $errorData,
46 * Function returns array of result expected from previous function.
51 function price_field_value_create_expectedresult() {
53 $expectedResult = array(
61 'price_field_id' => '13',
63 'label' => 'memType1',
69 'membership_type_id' => '5',
70 'membership_num_terms' => '2',
73 'financial_type_id' => '2',
74 'deductible_amount' => '',
75 'contribution_type_id' => '2',
80 return $expectedResult;
84 * This example has been generated from the API test suite.
85 * The test that created it is called
86 * testCreatePriceFieldValuewithMultipleTerms
88 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceFieldValueTest.php
90 * You can see the outcome of the API tests at
91 * https://test.civicrm.org/job/CiviCRM-master-git/
93 * To Learn about the API read
94 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
96 * Browse the api on your own site with the api explorer
97 * http://MYSITE.ORG/path/to/civicrm/api/explorer
99 * Read more about testing here
100 * http://wiki.civicrm.org/confluence/display/CRM/Testing
102 * API Standards documentation:
103 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards