3 * Test Generated example of using custom_group create API
6 function custom_group_create_example(){
8 'title' => 'Test_Group_1',
9 'name' => 'test_group_1',
14 'collapse_display' => 1,
16 'help_pre' => 'This is Pre Help For Test Group 1',
17 'help_post' => 'This is Post Help For Test Group 1',
22 $result = civicrm_api3('custom_group', 'create', $params);
24 catch (CiviCRM_API3_Exception
$e) {
26 $errorMessage = $e->getMessage();
27 $errorCode = $e->getErrorCode();
28 $errorData = $e->getExtraParams();
29 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
36 * Function returns array of result expected from previous function
38 function custom_group_create_expectedresult(){
40 $expectedResult = array(
48 'name' => 'test_group_1',
49 'title' => 'Test_Group_1',
50 'extends' => 'Individual',
51 'extends_entity_column_id' => '',
52 'extends_entity_column_value' => '',
54 'collapse_display' => '1',
55 'help_pre' => 'This is Pre Help For Test Group 1',
56 'help_post' => 'This is Post Help For Test Group 1',
59 'table_name' => 'civicrm_value_test_group_1_1',
63 'collapse_adv_display' => '',
71 return $expectedResult;
76 * This example has been generated from the API test suite. The test that created it is called
78 * testCustomGroupCreate and can be found in
79 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/CustomGroupTest.php
81 * You can see the outcome of the API tests at
82 * http://tests.dev.civicrm.org/trunk/results-api_v3
84 * To Learn about the API read
85 * http://book.civicrm.org/developer/current/techniques/api/
87 * and review the wiki at
88 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
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