Merge pull request #583 from yashodha/CRM-12463
[civicrm-core.git] / api / v3 / examples / ImGet.php
1 <?php
2
3 /*
4
5 */
6 function im_get_example(){
7 $params = array(
8 'version' => 3,
9 'contact_id' => 1,
10 'name' => 'My Yahoo IM Handle',
11 'location_type_id' => 1,
12 'provider_id' => 1,
13 );
14
15 $result = civicrm_api( 'im','get',$params );
16
17 return $result;
18 }
19
20 /*
21 * Function returns array of result expected from previous function
22 */
23 function im_get_expectedresult(){
24
25 $expectedResult = array(
26 'is_error' => 0,
27 'version' => 3,
28 'count' => 1,
29 'id' => 1,
30 'values' => array(
31 '1' => array(
32 'id' => '1',
33 'contact_id' => '1',
34 'location_type_id' => '1',
35 'name' => 'My Yahoo IM Handle',
36 'provider_id' => '1',
37 'is_primary' => 0,
38 'is_billing' => 0,
39 ),
40 ),
41 );
42
43 return $expectedResult ;
44 }
45
46
47 /*
48 * This example has been generated from the API test suite. The test that created it is called
49 *
50 * testGetIm and can be found in
51 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ImTest.php
52 *
53 * You can see the outcome of the API tests at
54 * http://tests.dev.civicrm.org/trunk/results-api_v3
55 *
56 * To Learn about the API read
57 * http://book.civicrm.org/developer/current/techniques/api/
58 *
59 * and review the wiki at
60 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
61 *
62 * Read more about testing here
63 * http://wiki.civicrm.org/confluence/display/CRM/Testing
64 *
65 * API Standards documentation:
66 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
67 */