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