3 * Test Generated example demonstrating the Domain.create API.
8 function domain_create_example() {
10 'name' => 'A-team domain',
11 'description' => 'domain of chaos',
12 'domain_version' => '4.2',
17 $result = civicrm_api3('Domain', 'create', $params);
19 catch (CiviCRM_API3_Exception
$e) {
21 $errorMessage = $e->getMessage();
22 $errorCode = $e->getErrorCode();
23 $errorData = $e->getExtraParams();
26 'error_message' => $errorMessage,
27 'error_code' => $errorCode,
28 'error_data' => $errorData,
36 * Function returns array of result expected from previous function.
41 function domain_create_expectedresult() {
51 'name' => 'A-team domain',
52 'description' => 'domain of chaos',
53 'config_backend' => '',
56 'locale_custom_strings' => '',
57 'domain_version' => '4.2',
62 return $expectedResult;
66 * This example has been generated from the API test suite.
67 * The test that created it is called "testCreate"
68 * and can be found at:
69 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/DomainTest.php
71 * You can see the outcome of the API tests at
72 * https://test.civicrm.org/job/CiviCRM-Core-Matrix/
74 * To Learn about the API read
75 * https://docs.civicrm.org/dev/en/latest/api/
77 * Browse the API on your own site with the API Explorer. It is in the main
78 * CiviCRM menu, under: Support > Development > API Explorer.
80 * Read more about testing here
81 * https://docs.civicrm.org/dev/en/latest/testing/
83 * API Standards documentation:
84 * https://docs.civicrm.org/dev/en/latest/framework/api-architecture/