Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ||
3 | /* | |
4 | ||
5 | */ | |
6 | function event_update_example(){ | |
7 | $params = array( | |
8 | '0' => array( | |
9 | 'title' => 'Annual CiviCRM meet', | |
10 | 'summary' => 'If you have any CiviCRM realted issues or want to track where CiviCRM is heading, Sign up now', | |
11 | 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues', | |
12 | 'event_type_id' => 1, | |
13 | 'is_public' => 1, | |
14 | 'start_date' => 20081021, | |
15 | 'end_date' => 20081023, | |
16 | 'is_online_registration' => 1, | |
17 | 'registration_start_date' => 20080601, | |
18 | 'registration_end_date' => '2008-10-15', | |
19 | 'max_participants' => 100, | |
20 | 'event_full_text' => 'Sorry! We are already full', | |
21 | 'is_monetary' => 0, | |
22 | 'is_active' => 1, | |
23 | 'is_show_location' => 0, | |
24 | 'version' => 3, | |
25 | ), | |
26 | '1' => array( | |
27 | 'title' => 'Annual CiviCRM meet 2', | |
28 | 'summary' => 'If you have any CiviCRM realted issues or want to track where CiviCRM is heading, Sign up now', | |
29 | 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues', | |
30 | 'event_type_id' => 1, | |
31 | 'is_public' => 1, | |
32 | 'start_date' => 20101021, | |
33 | 'end_date' => 20101023, | |
34 | 'is_online_registration' => 1, | |
35 | 'registration_start_date' => 20100601, | |
36 | 'registration_end_date' => '2010-10-15', | |
37 | 'max_participants' => 100, | |
38 | 'event_full_text' => 'Sorry! We are already full', | |
39 | 'is_monetory' => 0, | |
40 | 'is_active' => 1, | |
41 | 'is_show_location' => 0, | |
42 | 'version' => 3, | |
43 | ), | |
44 | ); | |
45 | ||
46 | $result = civicrm_api( 'event','update',$params ); | |
47 | ||
48 | return $result; | |
49 | } | |
50 | ||
51 | /* | |
52 | * Function returns array of result expected from previous function | |
53 | */ | |
54 | function event_update_expectedresult(){ | |
55 | ||
56 | $expectedResult = array( | |
57 | 'is_error' => 0, | |
58 | 'version' => 3, | |
59 | 'count' => 1, | |
60 | 'id' => 3, | |
61 | 'values' => array( | |
62 | '3' => array( | |
63 | 'id' => '3', | |
64 | 'title' => 'Annual CiviCRM meet 2', | |
65 | 'event_title' => 'Annual CiviCRM meet 2', | |
66 | 'summary' => 'If you have any CiviCRM realted issues or want to track where CiviCRM is heading, Sign up now', | |
67 | 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues', | |
68 | 'event_description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues', | |
69 | 'event_type_id' => '1', | |
70 | 'participant_listing_id' => 0, | |
71 | 'is_public' => '1', | |
72 | 'start_date' => '2010-10-21 00:00:00', | |
73 | 'event_start_date' => '2010-10-21 00:00:00', | |
74 | 'end_date' => '2010-10-23 00:00:00', | |
75 | 'event_end_date' => '2010-10-23 00:00:00', | |
76 | 'is_online_registration' => '1', | |
77 | 'registration_start_date' => '2010-06-01 00:00:00', | |
78 | 'registration_end_date' => '2010-10-15 00:00:00', | |
79 | 'max_participants' => '150', | |
80 | 'event_full_text' => 'Sorry! We are already full', | |
81 | 'is_monetary' => 0, | |
82 | 'is_map' => 0, | |
83 | 'is_active' => '1', | |
84 | 'is_show_location' => 0, | |
85 | 'default_role_id' => '1', | |
86 | 'is_email_confirm' => 0, | |
87 | 'is_pay_later' => 0, | |
88 | 'is_partial_payment' => 0, | |
89 | 'is_multiple_registrations' => 0, | |
90 | 'allow_same_participant_emails' => 0, | |
91 | 'is_template' => 0, | |
92 | 'created_date' => '2013-02-04 22:31:28', | |
93 | 'is_share' => '1', | |
94 | ), | |
95 | ), | |
96 | ); | |
97 | ||
98 | return $expectedResult ; | |
99 | } | |
100 | ||
101 | ||
102 | /* | |
103 | * This example has been generated from the API test suite. The test that created it is called | |
104 | * | |
105 | * testUpdateEvent and can be found in | |
106 | * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/EventTest.php | |
107 | * | |
108 | * You can see the outcome of the API tests at | |
109 | * http://tests.dev.civicrm.org/trunk/results-api_v3 | |
110 | * | |
111 | * To Learn about the API read | |
112 | * http://book.civicrm.org/developer/current/techniques/api/ | |
113 | * | |
114 | * and review the wiki at | |
115 | * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs | |
116 | * | |
117 | * Read more about testing here | |
118 | * http://wiki.civicrm.org/confluence/display/CRM/Testing | |
119 | * | |
120 | * API Standards documentation: | |
121 | * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards | |
122 | */ |