e4d84a7a823b6c85e3d1c95fe3dbc28a260eec6b
3 * Test Generated example of using price_field_value create API.
9 function price_field_value_create_example() {
11 'price_field_id' => 13,
12 'membership_type_id' => 5,
14 'label' => 'memType1',
16 'membership_num_terms' => 2,
18 'financial_type_id' => 2,
22 $result = civicrm_api3('price_field_value', 'create', $params);
24 catch (CiviCRM_API3_Exception
$e) {
26 $errorMessage = $e->getMessage();
27 $errorCode = $e->getErrorCode();
28 $errorData = $e->getExtraParams();
30 'error' => $errorMessage,
31 'error_code' => $errorCode,
32 'error_data' => $errorData,
40 * Function returns array of result expected from previous function.
45 function price_field_value_create_expectedresult() {
47 $expectedResult = array(
55 'price_field_id' => '13',
57 'label' => 'memType1',
63 'membership_type_id' => '5',
64 'membership_num_terms' => '2',
67 'financial_type_id' => '2',
68 'deductible_amount' => '',
69 'contribution_type_id' => '2',
74 return $expectedResult;
78 * This example has been generated from the API test suite.
79 * The test that created it is called
80 * testCreatePriceFieldValuewithMultipleTerms
82 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceFieldValueTest.php
84 * You can see the outcome of the API tests at
85 * https://test.civicrm.org/job/CiviCRM-master-git/
87 * To Learn about the API read
88 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
90 * Browse the api on your own site with the api explorer
91 * http://MYSITE.ORG/path/to/civicrm/api/explorer
93 * Read more about testing here
94 * http://wiki.civicrm.org/confluence/display/CRM/Testing
96 * API Standards documentation:
97 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards