3 * Test Generated example of using event get API
6 function event_get_example(){
8 'event_title' => 'Annual CiviCRM meet',
13 $result = civicrm_api3('event', 'get', $params);
15 catch (CiviCRM_API3_Exception
$e) {
17 $errorMessage = $e->getMessage();
18 $errorCode = $e->getErrorCode();
19 $errorData = $e->getExtraParams();
20 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
27 * Function returns array of result expected from previous function
29 function event_get_expectedresult(){
31 $expectedResult = array(
39 'title' => 'Annual CiviCRM meet',
40 'event_title' => 'Annual CiviCRM meet',
41 'event_type_id' => '1',
42 'participant_listing_id' => 0,
44 'start_date' => '2013-07-29 00:00:00',
45 'event_start_date' => '2013-07-29 00:00:00',
46 'is_online_registration' => 0,
50 'is_show_location' => '1',
51 'default_role_id' => '1',
52 'is_email_confirm' => 0,
54 'is_partial_payment' => 0,
55 'is_multiple_registrations' => 0,
56 'allow_same_participant_emails' => 0,
58 'created_date' => '2013-07-28 08:49:19',
60 'is_confirm_enabled' => '1',
65 return $expectedResult;
70 * This example has been generated from the API test suite. The test that created it is called
72 * testGetEventByEventTitle and can be found in
73 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EventTest.php
75 * You can see the outcome of the API tests at
76 * https://test.civicrm.org/job/CiviCRM-master-git/
78 * To Learn about the API read
79 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
81 * Browse the api on your own site with the api explorer
82 * http://MYSITE.ORG/path/to/civicrm/api/explorer
84 * Read more about testing here
85 * http://wiki.civicrm.org/confluence/display/CRM/Testing
87 * API Standards documentation:
88 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards