3 * Test Generated example of using event getsingle API
4 * demonstrates use of return is_full *
6 function event_getsingle_example(){
13 $result = civicrm_api3('event', 'getsingle', $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_getsingle_expectedresult(){
31 $expectedResult = array(
33 'title' => 'Annual CiviCRM meet',
34 'event_title' => 'Annual CiviCRM meet',
35 'event_type_id' => '1',
36 'participant_listing_id' => 0,
38 'start_date' => '2008-10-21 00:00:00',
39 'event_start_date' => '2008-10-21 00:00:00',
40 'is_online_registration' => 0,
41 'max_participants' => '1',
45 'is_show_location' => '1',
46 'default_role_id' => '1',
47 'is_email_confirm' => 0,
49 'is_partial_payment' => 0,
50 'is_multiple_registrations' => 0,
51 'allow_same_participant_emails' => 0,
53 'created_date' => '2013-07-28 19:57:44',
55 'available_places' => 0,
59 return $expectedResult;
64 * This example has been generated from the API test suite. The test that created it is called
66 * testGetSingleReturnIsFull and can be found in
67 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/EventTest.php
69 * You can see the outcome of the API tests at
70 * http://tests.dev.civicrm.org/trunk/results-api_v3
72 * To Learn about the API read
73 * http://book.civicrm.org/developer/current/techniques/api/
75 * and review the wiki at
76 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
78 * Read more about testing here
79 * http://wiki.civicrm.org/confluence/display/CRM/Testing
81 * API Standards documentation:
82 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards