3 * Test Generated example of using im create API
6 function im_create_example(){
9 'name' => 'My Yahoo IM Handle',
10 'location_type_id' => 1,
15 $result = civicrm_api3('im', 'create', $params);
17 catch (CiviCRM_API3_Exception
$e) {
19 $errorMessage = $e->getMessage();
20 $errorCode = $e->getErrorCode();
21 $errorData = $e->getExtraParams();
22 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
29 * Function returns array of result expected from previous function
31 function im_create_expectedresult(){
33 $expectedResult = array(
42 'location_type_id' => '1',
43 'name' => 'My Yahoo IM Handle',
51 return $expectedResult;
56 * This example has been generated from the API test suite. The test that created it is called
58 * testCreateIm and can be found in
59 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ImTest.php
61 * You can see the outcome of the API tests at
62 * https://test.civicrm.org/job/CiviCRM-master-git/
64 * To Learn about the API read
65 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
67 * Browse the api on your own site with the api explorer
68 * http://MYSITE.ORG/path/to/civicrm/api/explorer
70 * Read more about testing here
71 * http://wiki.civicrm.org/confluence/display/CRM/Testing
73 * API Standards documentation:
74 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards