Merge pull request #1226 from kurund/CRM-11137
[civicrm-core.git] / api / v3 / examples / EventGet.php
1 <?php
2
3 /*
4
5 */
6 function event_get_example(){
7 $params = array(
8 'event_title' => 'Annual CiviCRM meet',
9 'sequential' => true,
10 'version' => 3,
11 'debug' => 0,
12 );
13
14 $result = civicrm_api( 'event','get',$params );
15
16 return $result;
17 }
18
19 /*
20 * Function returns array of result expected from previous function
21 */
22 function event_get_expectedresult(){
23
24 $expectedResult = array(
25 'is_error' => 0,
26 'version' => 3,
27 'count' => 1,
28 'id' => 1,
29 'values' => array(
30 '0' => array(
31 'id' => '1',
32 'title' => 'Annual CiviCRM meet',
33 'event_title' => 'Annual CiviCRM meet',
34 'event_type_id' => '1',
35 'participant_listing_id' => 0,
36 'is_public' => '1',
37 'start_date' => '2008-10-21 00:00:00',
38 'event_start_date' => '2008-10-21 00:00:00',
39 'is_online_registration' => 0,
40 'is_monetary' => 0,
41 'is_map' => 0,
42 'is_active' => '1',
43 'is_show_location' => '1',
44 'default_role_id' => '1',
45 'is_email_confirm' => 0,
46 'is_pay_later' => 0,
47 'is_partial_payment' => 0,
48 'is_multiple_registrations' => 0,
49 'allow_same_participant_emails' => 0,
50 'is_template' => 0,
51 'created_date' => '20120130621222105',
52 'is_share' => '1',
53 ),
54 ),
55 );
56
57 return $expectedResult ;
58 }
59
60
61 /*
62 * This example has been generated from the API test suite. The test that created it is called
63 *
64 * testGetEventByEventTitle and can be found in
65 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/EventTest.php
66 *
67 * You can see the outcome of the API tests at
68 * http://tests.dev.civicrm.org/trunk/results-api_v3
69 *
70 * To Learn about the API read
71 * http://book.civicrm.org/developer/current/techniques/api/
72 *
73 * and review the wiki at
74 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
75 *
76 * Read more about testing here
77 * http://wiki.civicrm.org/confluence/display/CRM/Testing
78 *
79 * API Standards documentation:
80 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
81 */