4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using setting create API.
15 function setting_create_example() {
18 'uniq_email_per_site' => 1,
22 $result = civicrm_api3('setting', 'create', $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_create_expectedresult() {
47 $expectedResult = array(
54 'uniq_email_per_site' => '1',
59 return $expectedResult;
63 * This example has been generated from the API test suite.
64 * The test that created it is called
67 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
69 * You can see the outcome of the API tests at
70 * https://test.civicrm.org/job/CiviCRM-master-git/
72 * To Learn about the API read
73 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
75 * Browse the api on your own site with the api explorer
76 * http://MYSITE.ORG/path/to/civicrm/api/explorer
78 * Read more about testing here
79 * http://wiki.civicrm.org/confluence/display/CRM/Testing
81 * API Standards documentation:
82 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards