3 * Test Generated example of using option_value get API.
9 function option_value_get_example() {
11 'option_group_id' => 1,
15 $result = civicrm_api3('option_value', 'get', $params);
17 catch (CiviCRM_API3_Exception
$e) {
19 $errorMessage = $e->getMessage();
20 $errorCode = $e->getErrorCode();
21 $errorData = $e->getExtraParams();
23 'error' => $errorMessage,
24 'error_code' => $errorCode,
25 'error_data' => $errorData,
33 * Function returns array of result expected from previous function.
38 function option_value_get_expectedresult() {
40 $expectedResult = array(
47 'option_group_id' => '1',
58 'option_group_id' => '1',
69 'option_group_id' => '1',
70 'label' => 'Postal Mail',
80 'option_group_id' => '1',
91 'option_group_id' => '1',
103 return $expectedResult;
107 * This example has been generated from the API test suite.
108 * The test that created it is called
110 * and can be found in
111 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OptionValueTest.php
113 * You can see the outcome of the API tests at
114 * https://test.civicrm.org/job/CiviCRM-master-git/
116 * To Learn about the API read
117 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
119 * Browse the api on your own site with the api explorer
120 * http://MYSITE.ORG/path/to/civicrm/api
122 * Read more about testing here
123 * http://wiki.civicrm.org/confluence/display/CRM/Testing
125 * API Standards documentation:
126 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards