3 * Test Generated example of using uf_group create API
6 function uf_group_create_example(){
9 'add_contact_to_group' => 1,
11 'cancel_URL' => 'http://example.org/cancel',
12 'created_date' => '2009-06-27 00:00:00',
14 'group_type' => 'Individual,Contact',
15 'help_post' => 'help post',
16 'help_pre' => 'help pre',
23 'is_update_dupe' => 1,
24 'name' => 'Test_Group',
25 'notify' => 'admin@example.org',
26 'post_URL' => 'http://example.org/post',
27 'title' => 'Test Group',
31 $result = civicrm_api3('uf_group', 'create', $params);
33 catch (CiviCRM_API3_Exception
$e) {
35 $errorMessage = $e->getMessage();
36 $errorCode = $e->getErrorCode();
37 $errorData = $e->getExtraParams();
38 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
45 * Function returns array of result expected from previous function
47 function uf_group_create_expectedresult(){
49 $expectedResult = array(
58 'group_type' => 'Individual,Contact',
59 'title' => 'Test Group',
61 'help_pre' => 'help pre',
62 'help_post' => 'help post',
63 'limit_listings_group_id' => '1',
64 'post_URL' => 'http://example.org/post',
65 'add_to_group_id' => '1',
68 'is_edit_link' => '1',
70 'is_update_dupe' => '1',
71 'cancel_URL' => 'http://example.org/cancel',
73 'notify' => 'admin@example.org',
75 'name' => 'Test_Group_2',
77 'created_date' => '2013-07-28 08:49:19',
78 'is_proximity_search' => '',
83 return $expectedResult;
88 * This example has been generated from the API test suite. The test that created it is called
90 * testUFGroupCreate and can be found in
91 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/UFGroupTest.php
93 * You can see the outcome of the API tests at
94 * http://tests.dev.civicrm.org/trunk/results-api_v3
96 * To Learn about the API read
97 * http://book.civicrm.org/developer/current/techniques/api/
99 * and review the wiki at
100 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
102 * Read more about testing here
103 * http://wiki.civicrm.org/confluence/display/CRM/Testing
105 * API Standards documentation:
106 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards