Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ||
3 | /* | |
4 | ||
5 | */ | |
6 | function group_get_example(){ | |
53ca8fd7 | 7 | $params = array( |
6a488035 | 8 | 'version' => 3, |
53ca8fd7 | 9 | 'name' => 'Test Group 1_5', |
6a488035 TO |
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 | ||
53ca8fd7 | 22 | $expectedResult = array( |
6a488035 TO |
23 | 'is_error' => 0, |
24 | 'version' => 3, | |
25 | 'count' => 1, | |
53ca8fd7 | 26 | 'id' => 5, |
27 | 'values' => array( | |
28 | '5' => array( | |
29 | 'id' => '5', | |
30 | 'name' => 'Test Group 1_5', | |
6a488035 TO |
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', | |
53ca8fd7 | 37 | 'where_clause' => ' ( `civicrm_group_contact-5`.group_id IN ( 5 ) AND `civicrm_group_contact-5`.status IN ("Added") ) ', |
38 | 'select_tables' => 'a:9:{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-5`";s:114:" LEFT JOIN civicrm_group_contact `civicrm_group_contact-5` ON contact_a.id = `civicrm_group_contact-5`.contact_id ";}', | |
39 | 'where_tables' => 'a:2:{s:15:"civicrm_contact";i:1;s:25:"`civicrm_group_contact-5`";s:114:" LEFT JOIN civicrm_group_contact `civicrm_group_contact-5` ON contact_a.id = `civicrm_group_contact-5`.contact_id ";}', | |
40 | 'group_type' => array( | |
6a488035 TO |
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 | */ |