6 class Participant
extends PHPUnit_Framework_Testcase
{
8 * Helper function to create a Participant.
10 * @param int $contactId
14 * id of created Participant
16 public static function create($contactId, $eventId) {
21 'event_id' => $eventId,
22 'register_date' => date('Y-m-d') . " 00:00:00",
25 'source' => 'Event_' . $eventId,
26 'contact_id' => $contactId,
29 require_once 'CRM/Event/BAO/Participant.php';
30 $participant = CRM_Event_BAO_Participant
::add($params);
31 return $participant->id
;
35 * Helper function to delete a participant.
37 * @param int $participantId
39 * true if participant deleted, false otherwise
41 public static function delete($participantId) {
42 require_once 'CRM/Event/BAO/Participant.php';
43 return CRM_Event_BAO_Participant
::deleteParticipant($participantId);