INFRA-132 - phpcbf Drupal.WhiteSpace.ScopeIndent.IncorrectExact
[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 int $contactId
12 *
13 * @return int
14 * id of created Event
15 */
16 public static function create($contactId) {
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
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 int $eventId
40 * @return bool
41 * true if event deleted, false otherwise
42 */
43 public static function delete($eventId) {
44 return CRM_Event_BAO_Event::del($eventId);
45 }
46
47 }