$options = array(
'offset' => CRM_Utils_Rule::integer($offset) ? $offset : NULL,
- 'limit' => CRM_Utils_Rule::integer($limit) ? $limit : NULL,
+ 'limit' => (!$is_count && CRM_Utils_Rule::integer($limit)) ? $limit : NULL,
'is_count' => $is_count,
'return' => !empty($returnProperties) ? $returnProperties : array(),
);
$this->quickCleanup($tablesToTruncate, TRUE);
}
+ /**
+ * Check that getCount can count past 25.
+ */
+ public function testGetCountLimit() {
+ $contactIDs = [];
+
+ for ($count = $this->callAPISuccessGetCount('Participant', []); $count < 27; $count++) {
+ $contactIDs[] = $contactID = $this->individualCreate();
+ $this->participantCreate(['contact_id' => $contactID, 'event_id' => $this->_eventID]);
+ }
+ $this->callAPISuccessGetCount('Participant', [], 27);
+
+ foreach ($contactIDs as $contactID) {
+ $this->callAPISuccess('Contact', 'delete', ['id' => $contactID]);
+ }
+ }
+
/**
* Test get participants with role_id.
*/