3 * Test Generated example of using price_set create API
6 function price_set_create_example(){
8 'name' => 'default_goat_priceset',
9 'title' => 'Goat accessories',
11 'help_pre' => 'Please describe your goat in detail',
12 'help_post' => 'thank you for your time',
14 'financial_type_id' => 1,
15 'is_quick_config' => 1,
20 $result = civicrm_api3('price_set', 'create', $params);
22 catch (CiviCRM_API3_Exception
$e) {
24 $errorMessage = $e->getMessage();
25 $errorCode = $e->getErrorCode();
26 $errorData = $e->getExtraParams();
27 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
34 * Function returns array of result expected from previous function
36 function price_set_create_expectedresult(){
38 $expectedResult = array(
47 'name' => 'default_goat_priceset',
48 'title' => 'Goat accessories',
50 'help_pre' => 'Please describe your goat in detail',
51 'help_post' => 'thank you for your time',
54 'financial_type_id' => '1',
55 'is_quick_config' => '1',
61 return $expectedResult;
66 * This example has been generated from the API test suite. The test that created it is called
68 * testCreatePriceSet and can be found in
69 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/PriceSetTest.php
71 * You can see the outcome of the API tests at
72 * http://tests.dev.civicrm.org/trunk/results-api_v3
74 * To Learn about the API read
75 * http://book.civicrm.org/developer/current/techniques/api/
77 * and review the wiki at
78 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
80 * Read more about testing here
81 * http://wiki.civicrm.org/confluence/display/CRM/Testing
83 * API Standards documentation:
84 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards