Merge pull request #1214 from davecivicrm/CRM-12788
[civicrm-core.git] / api / v3 / examples / GroupContactGet.php
1 <?php
2
3 /*
4
5 */
6 function group_contact_get_example(){
7 $params = array(
8 'contact_id' => 3,
9 'version' => 3,
10 );
11
12 $result = civicrm_api( 'group_contact','get',$params );
13
14 return $result;
15 }
16
17 /*
18 * Function returns array of result expected from previous function
19 */
20 function group_contact_get_expectedresult(){
21
22 $expectedResult = array(
23 'is_error' => 0,
24 'version' => 3,
25 'count' => 1,
26 'id' => 1,
27 'values' => array(
28 '1' => array(
29 'id' => '1',
30 'group_id' => '1',
31 'title' => 'New Test Group Created',
32 'visibility' => 'Public Pages',
33 'is_hidden' => 0,
34 'in_date' => '2013-06-22 08:50:14',
35 'in_method' => 'API',
36 ),
37 ),
38 );
39
40 return $expectedResult ;
41 }
42
43
44 /*
45 * This example has been generated from the API test suite. The test that created it is called
46 *
47 * testGet and can be found in
48 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/GroupContactTest.php
49 *
50 * You can see the outcome of the API tests at
51 * http://tests.dev.civicrm.org/trunk/results-api_v3
52 *
53 * To Learn about the API read
54 * http://book.civicrm.org/developer/current/techniques/api/
55 *
56 * and review the wiki at
57 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
58 *
59 * Read more about testing here
60 * http://wiki.civicrm.org/confluence/display/CRM/Testing
61 *
62 * API Standards documentation:
63 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
64 */