4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using domain create API.
15 function domain_create_example() {
17 'name' => 'A-team domain',
18 'description' => 'domain of chaos',
19 'domain_version' => '4.2',
24 $result = civicrm_api3('domain', 'create', $params);
26 catch (CiviCRM_API3_Exception
$e) {
28 $errorMessage = $e->getMessage();
29 $errorCode = $e->getErrorCode();
30 $errorData = $e->getExtraParams();
32 'error' => $errorMessage,
33 'error_code' => $errorCode,
34 'error_data' => $errorData,
42 * Function returns array of result expected from previous function.
47 function domain_create_expectedresult() {
49 $expectedResult = array(
57 'name' => 'A-team domain',
58 'description' => 'domain of chaos',
59 'config_backend' => '',
63 'locale_custom_strings' => '',
68 return $expectedResult;
72 * This example has been generated from the API test suite.
73 * The test that created it is called
76 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/DomainTest.php
78 * You can see the outcome of the API tests at
79 * https://test.civicrm.org/job/CiviCRM-master-git/
81 * To Learn about the API read
82 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
84 * Browse the api on your own site with the api explorer
85 * http://MYSITE.ORG/path/to/civicrm/api/explorer
87 * Read more about testing here
88 * http://wiki.civicrm.org/confluence/display/CRM/Testing
90 * API Standards documentation:
91 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards