2 class Participant
extends PHPUnit_Framework_Testcase
{
4 * Helper function to create a Participant
9 * @return mixed $participant id of created Participant
11 static function create($contactId, $eventId) {
16 'event_id' => $eventId,
17 'register_date' => date('Y-m-d') . " 00:00:00",
20 'source' => 'Event_' . $eventId,
21 'contact_id' => $contactId,
24 require_once 'CRM/Event/BAO/Participant.php';
25 $participant = CRM_Event_BAO_Participant
::add($params);
26 return $participant->id
;
30 * Helper function to delete a participant
32 * @param $participantId
33 * @internal param int $participantID id of the participant to delete
34 * @return boolean true if participant deleted, false otherwise
36 static function delete($participantId) {
37 require_once 'CRM/Event/BAO/Participant.php';
38 return CRM_Event_BAO_Participant
::deleteParticipant($participantId);