Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ||
3 | /* | |
4 | ||
5 | */ | |
6 | function group_get_example(){ | |
7 | $params = array( | |
8 | 'version' => 3, | |
9 | 'name' => 'Test Group 1_6', | |
10 | ); | |
11 | ||
12 | $result = civicrm_api( 'group','get',$params ); | |
13 | ||
14 | return $result; | |
15 | } | |
16 | ||
17 | /* | |
18 | * Function returns array of result expected from previous function | |
19 | */ | |
20 | function group_get_expectedresult(){ | |
21 | ||
22 | $expectedResult = array( | |
23 | 'is_error' => 0, | |
24 | 'version' => 3, | |
25 | 'count' => 1, | |
26 | 'id' => 6, | |
27 | 'values' => array( | |
28 | '6' => array( | |
29 | 'id' => '6', | |
30 | 'name' => 'Test Group 1_6', | |
31 | 'title' => 'New Test Group Created', | |
32 | 'description' => 'New Test Group Created', | |
33 | 'source' => '', | |
34 | 'saved_search_id' => '', | |
35 | 'is_active' => '1', | |
36 | 'visibility' => 'Public Pages', | |
37 | 'where_clause' => ' ( `civicrm_group_contact-6`.group_id IN ( 6 ) AND `civicrm_group_contact-6`.status IN ("Added") ) ', | |
38 | 'select_tables' => 'a:12:{s:15:"civicrm_contact";i:1;s:15:"civicrm_address";i:1;s:22:"civicrm_state_province";i:1;s:15:"civicrm_country";i:1;s:13:"civicrm_email";i:1;s:13:"civicrm_phone";i:1;s:10:"civicrm_im";i:1;s:19:"civicrm_worldregion";i:1;s:25:"`civicrm_group_contact-6`";s:114:" LEFT JOIN civicrm_group_contact `civicrm_group_contact-6` ON contact_a.id = `civicrm_group_contact-6`.contact_id ";s:6:"gender";i:1;s:17:"individual_prefix";i:1;s:17:"individual_suffix";i:1;}', | |
39 | 'where_tables' => 'a:2:{s:15:"civicrm_contact";i:1;s:25:"`civicrm_group_contact-6`";s:114:" LEFT JOIN civicrm_group_contact `civicrm_group_contact-6` ON contact_a.id = `civicrm_group_contact-6`.contact_id ";}', | |
40 | 'group_type' => array( | |
41 | '0' => '1', | |
42 | '1' => '2', | |
43 | ), | |
44 | 'cache_date' => '', | |
45 | 'refresh_date' => '', | |
46 | 'parents' => '', | |
47 | 'children' => '', | |
48 | 'is_hidden' => 0, | |
49 | 'is_reserved' => 0, | |
50 | 'created_id' => '', | |
51 | ), | |
52 | ), | |
53 | ); | |
54 | ||
55 | return $expectedResult ; | |
56 | } | |
57 | ||
58 | ||
59 | /* | |
60 | * This example has been generated from the API test suite. The test that created it is called | |
61 | * | |
62 | * testGetGroupParamsWithGroupName and can be found in | |
63 | * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/GroupTest.php | |
64 | * | |
65 | * You can see the outcome of the API tests at | |
66 | * http://tests.dev.civicrm.org/trunk/results-api_v3 | |
67 | * | |
68 | * To Learn about the API read | |
69 | * http://book.civicrm.org/developer/current/techniques/api/ | |
70 | * | |
71 | * and review the wiki at | |
72 | * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs | |
73 | * | |
74 | * Read more about testing here | |
75 | * http://wiki.civicrm.org/confluence/display/CRM/Testing | |
76 | * | |
77 | * API Standards documentation: | |
78 | * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards | |
79 | */ |