Commit | Line | Data |
---|---|---|
6a488035 | 1 | <?php |
aba1cd8b EM |
2 | |
3 | /** | |
4 | * Class Event | |
5 | */ | |
6a488035 TO |
6 | class Event extends PHPUnit_Framework_Testcase { |
7 | /** | |
8 | * Helper function to create | |
9 | * an Event | |
10 | * | |
2a6da8d7 EM |
11 | * @param $contactId |
12 | * | |
13 | * @return mixed $event id of created Event | |
6a488035 TO |
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 | * | |
c490a46a | 39 | * @param int $eventId |
6a488035 | 40 | * @return boolean true if event deleted, false otherwise |
6a488035 TO |
41 | */ |
42 | static function delete($eventId) { | |
43 | return CRM_Event_BAO_Event::del($eventId); | |
44 | } | |
45 | } | |
46 | ||
47 | ||
48 |