3 * Test Generated example of using uf_group 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('uf_group', 'create', $params);
35 catch (CiviCRM_API3_Exception
$e) {
37 $errorMessage = $e->getMessage();
38 $errorCode = $e->getErrorCode();
39 $errorData = $e->getExtraParams();
41 'error' => $errorMessage,
42 'error_code' => $errorCode,
43 'error_data' => $errorData,
51 * Function returns array of result expected from previous function.
56 function uf_group_create_expectedresult() {
58 $expectedResult = array(
67 'group_type' => 'Individual,Contact',
68 'title' => 'Test Group',
70 'help_pre' => 'help pre',
71 'help_post' => 'help post',
72 'limit_listings_group_id' => '1',
73 'post_URL' => 'http://example.org/post',
74 'add_to_group_id' => '1',
77 'is_edit_link' => '1',
79 'is_update_dupe' => '1',
80 'cancel_URL' => 'http://example.org/cancel',
82 'notify' => 'admin@example.org',
84 'name' => 'Test_Group_2',
86 'created_date' => '2013-07-28 08:49:19',
87 'is_proximity_search' => '',
92 return $expectedResult;
96 * This example has been generated from the API test suite.
97 * The test that created it is called
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