ade13f1fbe2cad305c994de0139787cd521303c5
3 * Test Generated example demonstrating the UFGroup.create API.
8 function uf_group_create_example() {
11 'add_contact_to_group' => 1,
13 'cancel_URL' => 'http://example.org/cancel',
14 'created_date' => '2009-06-27 00:00:00',
16 'group_type' => 'Individual,Contact',
17 'help_post' => 'help post',
18 'help_pre' => 'help pre',
25 'is_update_dupe' => 1,
26 'name' => 'Test_Group',
27 'notify' => 'admin@example.org',
28 'post_URL' => 'http://example.org/post',
29 'title' => 'Test Group',
33 $result = civicrm_api3('UFGroup', 'create', $params);
35 catch (CiviCRM_API3_Exception
$e) {
37 $errorMessage = $e->getMessage();
38 $errorCode = $e->getErrorCode();
39 $errorData = $e->getExtraParams();
42 'error_message' => $errorMessage,
43 'error_code' => $errorCode,
44 'error_data' => $errorData,
52 * Function returns array of result expected from previous function.
57 function uf_group_create_expectedresult() {
59 $expectedResult = array(
68 'group_type' => 'Individual,Contact',
69 'title' => 'Test Group',
71 'help_pre' => 'help pre',
72 'help_post' => 'help post',
73 'limit_listings_group_id' => '1',
74 'post_URL' => 'http://example.org/post',
75 'add_to_group_id' => '1',
78 'is_edit_link' => '1',
80 'is_update_dupe' => '1',
81 'cancel_URL' => 'http://example.org/cancel',
83 'notify' => 'admin@example.org',
85 'name' => 'Test_Group',
87 'created_date' => '2013-07-28 08:49:19',
88 'is_proximity_search' => '',
93 return $expectedResult;
97 * This example has been generated from the API test suite.
98 * The test that created it is called "testUFGroupCreate"
99 * and can be found at:
100 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFGroupTest.php
102 * You can see the outcome of the API tests at
103 * https://test.civicrm.org/job/CiviCRM-master-git/
105 * To Learn about the API read
106 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
108 * Browse the api on your own site with the api explorer
109 * http://MYSITE.ORG/path/to/civicrm/api
111 * Read more about testing here
112 * http://wiki.civicrm.org/confluence/display/CRM/Testing
114 * API Standards documentation:
115 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards