Import from SVN (r45945, r596)
[civicrm-core.git] / tests / phpunit / CiviTest / Event.php
1 <?php
2 class Event extends PHPUnit_Framework_Testcase {
3 /**
4 * Helper function to create
5 * an Event
6 *
7 * @return $event id of created Event
8 */
9 static function create($contactId) {
10 require_once "CRM/Event/BAO/Event.php";
11 $params = array(
12 'title' => 'Test Event',
13 'event_type_id' => 1,
14 'default_role_id' => 1,
15 'participant_listing_id' => 1,
16 'summary' => 'Created for Test Coverage BAO',
17 'description' => 'Test Coverage BAO',
18 'is_public' => 1,
19 'start_date' => '20080526200000',
20 'end_date' => '20080530200000',
21 'is_active' => 1,
22 'contact_id' => $contactId,
23 );
24
25
26 $event = CRM_Event_BAO_Event::create($params);
27 return $event->id;
28 }
29
30 /**
31 * Helper function to delete an Event
32 *
33 * @param int $eventID id of the event to delete
34 * @return boolean true if event deleted, false otherwise
35 *
36 */
37 static function delete($eventId) {
38 return CRM_Event_BAO_Event::del($eventId);
39 }
40 }
41
42
43