Merge pull request #266 from colemanw/CRM-12229
[civicrm-core.git] / api / v3 / examples / OptionGroupGet.php
1 <?php
2
3 /*
4
5 */
6 function option_group_get_example(){
7 $params = array(
8 'name' => 'preferred_communication_method',
9 'version' => 3,
10 );
11
12 $result = civicrm_api( 'option_group','get',$params );
13
14 return $result;
15 }
16
17 /*
18 * Function returns array of result expected from previous function
19 */
20 function option_group_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 'name' => 'preferred_communication_method',
31 'title' => 'Preferred Communication Method',
32 'is_reserved' => '1',
33 'is_active' => '1',
34 ),
35 ),
36 );
37
38 return $expectedResult ;
39 }
40
41
42 /*
43 * This example has been generated from the API test suite. The test that created it is called
44 *
45 * testGetOptionGroupByName and can be found in
46 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/OptionGroupTest.php
47 *
48 * You can see the outcome of the API tests at
49 * http://tests.dev.civicrm.org/trunk/results-api_v3
50 *
51 * To Learn about the API read
52 * http://book.civicrm.org/developer/current/techniques/api/
53 *
54 * and review the wiki at
55 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
56 *
57 * Read more about testing here
58 * http://wiki.civicrm.org/confluence/display/CRM/Testing
59 *
60 * API Standards documentation:
61 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
62 */