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 | * | |
100fef9d | 11 | * @param int $contactId |
2a6da8d7 | 12 | * |
72b3a70c CW |
13 | * @return int |
14 | * id of created Event | |
6a488035 | 15 | */ |
00be9182 | 16 | public static function create($contactId) { |
6a488035 TO |
17 | require_once "CRM/Event/BAO/Event.php"; |
18 | $params = array( | |
19 | 'title' => 'Test Event', | |
20 | 'event_type_id' => 1, | |
21 | 'default_role_id' => 1, | |
22 | 'participant_listing_id' => 1, | |
23 | 'summary' => 'Created for Test Coverage BAO', | |
24 | 'description' => 'Test Coverage BAO', | |
25 | 'is_public' => 1, | |
26 | 'start_date' => '20080526200000', | |
27 | 'end_date' => '20080530200000', | |
28 | 'is_active' => 1, | |
29 | 'contact_id' => $contactId, | |
30 | ); | |
31 | ||
6a488035 TO |
32 | $event = CRM_Event_BAO_Event::create($params); |
33 | return $event->id; | |
34 | } | |
35 | ||
36 | /** | |
eceb18cc | 37 | * Helper function to delete an Event. |
6a488035 | 38 | * |
c490a46a | 39 | * @param int $eventId |
28a04ea9 | 40 | * @return bool |
a6c01b45 | 41 | * true if event deleted, false otherwise |
6a488035 | 42 | */ |
00be9182 | 43 | public static function delete($eventId) { |
6a488035 TO |
44 | return CRM_Event_BAO_Event::del($eventId); |
45 | } | |
96025800 | 46 | |
6a488035 | 47 | } |