4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using event getsingle API.
11 * demonstrates use of return is_full
16 function event_getsingle_example() {
19 'return.is_full' => 1,
23 $result = civicrm_api3('event', 'getsingle', $params);
25 catch (CiviCRM_API3_Exception
$e) {
27 $errorMessage = $e->getMessage();
28 $errorCode = $e->getErrorCode();
29 $errorData = $e->getExtraParams();
31 'error' => $errorMessage,
32 'error_code' => $errorCode,
33 'error_data' => $errorData,
41 * Function returns array of result expected from previous function.
46 function event_getsingle_expectedresult() {
48 $expectedResult = array(
50 'title' => 'Annual CiviCRM meet',
51 'event_title' => 'Annual CiviCRM meet',
52 'event_type_id' => '1',
53 'participant_listing_id' => 0,
55 'start_date' => '2008-10-21 00:00:00',
56 'event_start_date' => '2008-10-21 00:00:00',
57 'is_online_registration' => 0,
58 'max_participants' => '1',
62 'is_show_location' => '1',
63 'default_role_id' => '1',
64 'is_email_confirm' => 0,
66 'is_partial_payment' => 0,
67 'is_multiple_registrations' => 0,
68 'allow_same_participant_emails' => 0,
70 'created_date' => '2015-01-15 02:10:12',
72 'is_confirm_enabled' => '1',
73 'is_billing_required' => 0,
74 'available_places' => 0,
78 return $expectedResult;
82 * This example has been generated from the API test suite.
83 * The test that created it is called
84 * testGetSingleReturnIsFull
86 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EventTest.php
88 * You can see the outcome of the API tests at
89 * https://test.civicrm.org/job/CiviCRM-master-git/
91 * To Learn about the API read
92 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
94 * Browse the api on your own site with the api explorer
95 * http://MYSITE.ORG/path/to/civicrm/api/explorer
97 * Read more about testing here
98 * http://wiki.civicrm.org/confluence/display/CRM/Testing
100 * API Standards documentation:
101 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards