2 class Participant
extends PHPUnit_Framework_Testcase
{
4 * Helper function to create a Participant
6 * @return $participant id of created Participant
8 static function create($contactId, $eventId) {
13 'event_id' => $eventId,
14 'register_date' => date('Y-m-d') . " 00:00:00",
17 'source' => 'Event_' . $eventId,
18 'contact_id' => $contactId,
21 require_once 'CRM/Event/BAO/Participant.php';
22 $participant = CRM_Event_BAO_Participant
::add($params);
23 return $participant->id
;
27 * Helper function to delete a participant
29 * @param int $participantID id of the participant to delete
30 * @return boolean true if participant deleted, false otherwise
32 static function delete($participantId) {
33 require_once 'CRM/Event/BAO/Participant.php';
34 return CRM_Event_BAO_Participant
::deleteParticipant($participantId);