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