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