Skip to content

Commit

Permalink
CRM-18186: Tests for getting participants by registered_by_id
Browse files Browse the repository at this point in the history
  • Loading branch information
JKingsnorth committed Jul 5, 2016
1 parent 57a56c2 commit 9da1057
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/phpunit/api/v3/ParticipantTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function setUp() {
$this->_participantID2 = $this->participantCreate(array(
'contact_id' => $this->_contactID2,
'event_id' => $this->_eventID,
'registered_by_id' => $this->_participantID,
));
$this->_participantID3 = $this->participantCreate(array(
'contact_id' => $this->_contactID2,
Expand Down Expand Up @@ -343,6 +344,19 @@ public function testSearchByEventWithLimit() {
$this->assertEquals($participant['count'], 2);
}

/**
* Test search by lead booker (registered by ID)
*/
public function testSearchByRegisteredById() {
$params = array(
'registered_by_id' => $this->_participantID,
);
$participant = $this->callAPISuccess('participant', 'get', $params);

$this->assertEquals($participant['count'], 1);
$this->assertEquals($participant['id'], $this->_participantID2);
}

///////////////// civicrm_participant_create methods

/**
Expand Down

0 comments on commit 9da1057

Please sign in to comment.