4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using setting revert API.
11 * Demonstrates reverting a parameter to default value
16 function setting_revert_example() {
18 'name' => 'address_format',
22 $result = civicrm_api3('setting', 'revert', $params);
24 catch (CiviCRM_API3_Exception
$e) {
26 $errorMessage = $e->getMessage();
27 $errorCode = $e->getErrorCode();
28 $errorData = $e->getExtraParams();
30 'error' => $errorMessage,
31 'error_code' => $errorCode,
32 'error_data' => $errorData,
40 * Function returns array of result expected from previous function.
45 function setting_revert_expectedresult() {
47 $expectedResult = array(
59 'address_format' => '{contact.address_name}
60 {contact.street_address}
61 {contact.supplemental_address_1}
62 {contact.supplemental_address_2}
63 {contact.city}{, }{contact.state_province}{ }{contact.postal_code}
70 return $expectedResult;
74 * This example has been generated from the API test suite.
75 * The test that created it is called
78 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
80 * You can see the outcome of the API tests at
81 * https://test.civicrm.org/job/CiviCRM-master-git/
83 * To Learn about the API read
84 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
86 * Browse the api on your own site with the api explorer
87 * http://MYSITE.ORG/path/to/civicrm/api/explorer
89 * Read more about testing here
90 * http://wiki.civicrm.org/confluence/display/CRM/Testing
92 * API Standards documentation:
93 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards