update test generated examples
[civicrm-core.git] / api / v3 / examples / Contact / GroupFilterUsingContactAPI.php
CommitLineData
6a488035
TO
1<?php
2
3/*
4 Get all from group and display contacts
5 */
6function contact_get_example(){
edb0d67a 7$params = array(
8 'filter.group_id' => array(
6a488035
TO
9 '0' => 1,
10 '1' => 26,
11 ),
12 'version' => 3,
13 'contact_type' => 'Individual',
14);
15
16 $result = civicrm_api( 'contact','get',$params );
17
18 return $result;
19}
20
21/*
22 * Function returns array of result expected from previous function
23 */
24function contact_get_expectedresult(){
25
edb0d67a 26 $expectedResult = array(
6a488035
TO
27 'is_error' => 0,
28 'version' => 3,
29 'count' => 1,
30 'id' => 1,
edb0d67a 31 'values' => array(
32 '1' => array(
6a488035
TO
33 'contact_id' => '1',
34 'contact_type' => 'Individual',
35 'contact_sub_type' => '',
36 'sort_name' => 'man2@yahoo.com',
37 'display_name' => 'man2@yahoo.com',
38 'do_not_email' => 0,
39 'do_not_phone' => 0,
40 'do_not_mail' => 0,
41 'do_not_sms' => 0,
42 'do_not_trade' => 0,
43 'is_opt_out' => 0,
44 'legal_identifier' => '',
45 'external_identifier' => '',
46 'nick_name' => '',
47 'legal_name' => '',
48 'image_URL' => '',
49 'preferred_mail_format' => 'Both',
50 'first_name' => '',
51 'middle_name' => '',
52 'last_name' => '',
53 'job_title' => '',
54 'birth_date' => '',
55 'is_deceased' => 0,
56 'deceased_date' => '',
57 'household_name' => '',
58 'organization_name' => '',
59 'sic_code' => '',
60 'contact_is_deleted' => 0,
6a488035
TO
61 'current_employer' => '',
62 'address_id' => '',
63 'street_address' => '',
64 'supplemental_address_1' => '',
65 'supplemental_address_2' => '',
66 'city' => '',
67 'postal_code_suffix' => '',
68 'postal_code' => '',
69 'geo_code_1' => '',
70 'geo_code_2' => '',
71 'state_province_id' => '',
72 'state_province_name' => '',
73 'state_province' => '',
74 'country_id' => '',
75 'country' => '',
76 'phone_id' => '',
77 'phone_type_id' => '',
78 'phone' => '',
79 'email_id' => '1',
80 'email' => 'man2@yahoo.com',
81 'on_hold' => 0,
82 'im_id' => '',
83 'provider_id' => '',
84 'im' => '',
85 'worldregion_id' => '',
86 'world_region' => '',
87 'id' => '1',
88 ),
89 ),
90);
91
92 return $expectedResult ;
93}
94
95
96/*
97* This example has been generated from the API test suite. The test that created it is called
98*
99* testGetGroupIDFromContact and can be found in
100* http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ContactTest.php
101*
102* You can see the outcome of the API tests at
103* http://tests.dev.civicrm.org/trunk/results-api_v3
104*
105* To Learn about the API read
106* http://book.civicrm.org/developer/current/techniques/api/
107*
108* and review the wiki at
109* http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
110*
111* Read more about testing here
112* http://wiki.civicrm.org/confluence/display/CRM/Testing
113*
114* API Standards documentation:
115* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
116*/