3 * Test Generated example of using im create API.
9 function im_create_example() {
12 'name' => 'My Yahoo IM Handle',
13 'location_type_id' => 1,
18 $result = civicrm_api3('im', 'create', $params);
20 catch (CiviCRM_API3_Exception
$e) {
22 $errorMessage = $e->getMessage();
23 $errorCode = $e->getErrorCode();
24 $errorData = $e->getExtraParams();
26 'error' => $errorMessage,
27 'error_code' => $errorCode,
28 'error_data' => $errorData,
36 * Function returns array of result expected from previous function.
41 function im_create_expectedresult() {
43 $expectedResult = array(
52 'location_type_id' => '1',
53 'name' => 'My Yahoo IM Handle',
61 return $expectedResult;
65 * This example has been generated from the API test suite.
66 * The test that created it is called
69 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ImTest.php
71 * You can see the outcome of the API tests at
72 * https://test.civicrm.org/job/CiviCRM-master-git/
74 * To Learn about the API read
75 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
77 * Browse the api on your own site with the api explorer
78 * http://MYSITE.ORG/path/to/civicrm/api
80 * Read more about testing here
81 * http://wiki.civicrm.org/confluence/display/CRM/Testing
83 * API Standards documentation:
84 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards