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