3 +--------------------------------------------------------------------+
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2018 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * Test class for Batch API - civicrm_participant_*
31 * @package CiviCRM_APIv3
35 * Class api_v3_ParticipantTest
38 class api_v3_ParticipantTest
extends CiviUnitTestCase
{
40 protected $_apiversion;
42 protected $_contactID;
43 protected $_contactID2;
44 protected $_createdParticipants;
45 protected $_participantID;
47 protected $_individualId;
50 public function setUp() {
51 $this->_apiversion
= 3;
53 $this->_entity
= 'participant';
54 $event = $this->eventCreate(NULL);
55 $this->_eventID
= $event['id'];
57 $this->_contactID
= $this->individualCreate();
59 $this->_createdParticipants
= array();
60 $this->_individualId
= $this->individualCreate();
62 $this->_participantID
= $this->participantCreate(array(
63 'contact_id' => $this->_contactID
,
64 'event_id' => $this->_eventID
,
66 $this->_contactID2
= $this->individualCreate();
67 $this->_participantID2
= $this->participantCreate(array(
68 'contact_id' => $this->_contactID2
,
69 'event_id' => $this->_eventID
,
70 'registered_by_id' => $this->_participantID
,
72 $this->_participantID3
= $this->participantCreate(array(
73 'contact_id' => $this->_contactID2
,
74 'event_id' => $this->_eventID
,
76 $this->_params
= array(
77 'contact_id' => $this->_contactID
,
78 'event_id' => $this->_eventID
,
81 // to ensure it matches later on
82 'register_date' => '2007-07-21 00:00:00',
83 'source' => 'Online Event Registration: API Testing',
87 public function tearDown() {
88 $this->eventDelete($this->_eventID
);
89 $tablesToTruncate = array(
90 'civicrm_custom_group',
91 'civicrm_custom_field',
93 'civicrm_participant',
95 // true tells quickCleanup to drop any tables that might have been created in the test
96 $this->quickCleanup($tablesToTruncate, TRUE);
100 * Check that getCount can count past 25.
102 public function testGetCountLimit() {
105 for ($count = $this->callAPISuccessGetCount('Participant', []); $count < 27; $count++
) {
106 $contactIDs[] = $contactID = $this->individualCreate();
107 $this->participantCreate(['contact_id' => $contactID, 'event_id' => $this->_eventID
]);
109 $this->callAPISuccessGetCount('Participant', [], 27);
111 foreach ($contactIDs as $contactID) {
112 $this->callAPISuccess('Contact', 'delete', ['id' => $contactID]);
117 * Test get participants with role_id.
119 public function testGetParticipantWithRole() {
120 $roleId = array(1, 2, 3);
121 foreach ($roleId as $role) {
122 $this->participantCreate(array(
123 'contact_id' => $this->individualCreate(),
125 'event_id' => $this->_eventID
,
132 $result = $this->callAPISuccess('participant', 'get', $params);
133 //Assert all the returned participants has a role_id of 2
134 foreach ($result['values'] as $pid => $values) {
135 $this->assertEquals($values['participant_role_id'], 2);
138 $this->participantCreate(array(
139 'id' => $this->_participantID
,
141 'event_id' => $this->_eventID
,
144 $params['role_id'] = array(
147 $result = $this->callAPISuccess('participant', 'get', $params);
148 foreach ($result['values'] as $pid => $values) {
149 $this->assertEquals($values['participant_role_id'], NULL);
155 * Check with complete array + custom field
156 * Note that the test is written on purpose without any
157 * variables specific to participant so it can be replicated into other entities
158 * and / or moved to the automated test suite
160 public function testCreateWithCustom() {
161 $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__
, __FILE__
);
163 $params = $this->_params
;
164 $params['custom_' . $ids['custom_field_id']] = "custom string";
166 $result = $this->callAPIAndDocument($this->_entity
, 'create', $params, __FUNCTION__
, __FILE__
);
168 $this->assertEquals($result['id'], $result['values'][$result['id']]['id']);
170 $check = $this->callAPISuccess($this->_entity
, 'get', array('id' => $result['id']));
171 $this->assertEquals("custom string", $check['values'][$check['id']]['custom_' . $ids['custom_field_id']], ' in line ' . __LINE__
);
173 $this->customFieldDelete($ids['custom_field_id']);
174 $this->customGroupDelete($ids['custom_group_id']);
178 * Check with participant_id.
180 public function testGetParticipantIdOnly() {
182 'participant_id' => $this->_participantID
,
186 'participant_register_date',
187 'participant_source',
190 $result = $this->callAPISuccess('participant', 'get', $params);
191 $this->assertAPISuccess($result, " in line " . __LINE__
);
192 $this->assertEquals($result['values'][$this->_participantID
]['event_id'], $this->_eventID
);
193 $this->assertEquals($result['values'][$this->_participantID
]['participant_register_date'], '2007-02-19 00:00:00');
194 $this->assertEquals($result['values'][$this->_participantID
]['participant_source'], 'Wimbeldon');
196 'id' => $this->_participantID
,
197 'return' => 'id,participant_register_date,event_id',
200 $result = $this->callAPISuccess('participant', 'get', $params);
201 $this->assertEquals($result['values'][$this->_participantID
]['event_id'], $this->_eventID
);
202 $this->assertEquals($result['values'][$this->_participantID
]['participant_register_date'], '2007-02-19 00:00:00');
207 * Test permission for participant get.
209 public function testGetParticipantWithPermission() {
210 $config = CRM_Core_Config
::singleton();
211 $config->userPermissionClass
->permissions
= array();
213 'event_id' => $this->_eventID
,
214 'check_permissions' => TRUE,
218 'participant_register_date',
219 'participant_source',
222 $this->callAPIFailure('participant', 'get', $params);
224 $params['check_permissions'] = FALSE;
225 $result = $this->callAPISuccess('participant', 'get', $params);
226 $this->assertEquals($result['is_error'], 0);
231 * Check with params id.
233 public function testGetParamsAsIdOnly() {
235 'id' => $this->_participantID
,
237 $result = $this->callAPIAndDocument('participant', 'get', $params, __FUNCTION__
, __FILE__
);
238 $this->assertEquals($result['values'][$this->_participantID
]['event_id'], $this->_eventID
);
239 $this->assertEquals($result['values'][$this->_participantID
]['participant_register_date'], '2007-02-19 00:00:00');
240 $this->assertEquals($result['values'][$this->_participantID
]['participant_source'], 'Wimbeldon');
241 $this->assertEquals($result['id'], $result['values'][$this->_participantID
]['id']);
245 * Check with params id.
247 public function testGetNestedEventGet() {
248 //create a second event & add participant to it.
249 $event = $this->eventCreate(NULL);
250 $this->callAPISuccess('participant', 'create', array(
251 'event_id' => $event['id'],
252 'contact_id' => $this->_contactID
,
255 $description = "Demonstrates use of nested get to fetch event data with participant records.";
256 $subfile = "NestedEventGet";
258 'id' => $this->_participantID
,
259 'api.event.get' => 1,
261 $result = $this->callAPIAndDocument('participant', 'get', $params, __FUNCTION__
, __FILE__
, $description, $subfile);
262 $this->assertEquals($result['values'][$this->_participantID
]['event_id'], $this->_eventID
);
263 $this->assertEquals($result['values'][$this->_participantID
]['participant_register_date'], '2007-02-19 00:00:00');
264 $this->assertEquals($result['values'][$this->_participantID
]['participant_source'], 'Wimbeldon');
265 $this->assertEquals($this->_eventID
, $result['values'][$this->_participantID
]['api.event.get']['id']);
269 * Check Participant Get respects return properties.
271 public function testGetWithReturnProperties() {
273 'contact_id' => $this->_contactID
,
274 'return.status_id' => 1,
275 'return.participant_status_id' => 1,
276 'options' => array('limit' => 1),
278 $result = $this->callAPISuccess('participant', 'get', $params);
279 $this->assertArrayHasKey('participant_status_id', $result['values'][$result['id']]);
283 * Check with contact_id.
285 public function testGetContactIdOnly() {
287 'contact_id' => $this->_contactID
,
289 $participant = $this->callAPISuccess('participant', 'get', $params);
291 $this->assertEquals($this->_participantID
, $participant['id']);
292 $this->assertEquals($this->_eventID
, $participant['values'][$participant['id']]['event_id']);
293 $this->assertEquals('2007-02-19 00:00:00', $participant['values'][$participant['id']]['participant_register_date']);
294 $this->assertEquals('Wimbeldon', $participant['values'][$participant['id']]['participant_source']);
295 $this->assertEquals($participant['id'], $participant['values'][$participant['id']]['id']);
299 * Check with event_id.
302 public function testGetMultiMatchReturnFirst() {
304 'event_id' => $this->_eventID
,
308 $participant = $this->callAPISuccess('participant', 'get', $params);
309 $this->assertNotNull($participant['id']);
313 * Check with event_id.
314 * in v3 this should return all participants
316 public function testGetMultiMatchNoReturnFirst() {
318 'event_id' => $this->_eventID
,
320 $participant = $this->callAPISuccess('participant', 'get', $params);
321 $this->assertNotNull($participant['count'], 3);
324 ///////////////// civicrm_participant_get methods
327 * Test civicrm_participant_get with empty params.
328 * In this case all the participant records are returned.
330 public function testSearchEmptyParams() {
331 $result = $this->callAPISuccess('participant', 'get', array());
332 // expecting 3 participant records
333 $this->assertEquals($result['count'], 3);
337 * Check with participant_id.
339 public function testSearchParticipantIdOnly() {
341 'participant_id' => $this->_participantID
,
343 $participant = $this->callAPISuccess('participant', 'get', $params);
344 $this->assertEquals($participant['values'][$this->_participantID
]['event_id'], $this->_eventID
);
345 $this->assertEquals($participant['values'][$this->_participantID
]['participant_register_date'], '2007-02-19 00:00:00');
346 $this->assertEquals($participant['values'][$this->_participantID
]['participant_source'], 'Wimbeldon');
350 * Check with contact_id.
352 public function testSearchContactIdOnly() {
353 // Should get 2 participant records for this contact.
355 'contact_id' => $this->_contactID2
,
357 $participant = $this->callAPISuccess('participant', 'get', $params);
359 $this->assertEquals($participant['count'], 2);
363 * Check with event_id.
365 public function testSearchByEvent() {
366 // Should get >= 3 participant records for this event. Also testing that last_name and event_title are returned.
368 'event_id' => $this->_eventID
,
369 'return.last_name' => 1,
370 'return.event_title' => 1,
372 $participant = $this->callAPISuccess('participant', 'get', $params);
373 if ($participant['count'] < 3) {
374 $this->fail("Event search returned less than expected miniumum of 3 records.");
377 $this->assertEquals($participant['values'][$this->_participantID
]['last_name'], 'Anderson');
378 $this->assertEquals($participant['values'][$this->_participantID
]['event_title'], 'Annual CiviCRM meet');
382 * Check with event_id.
385 public function testSearchByEventWithLimit() {
386 // Should 2 participant records since we're passing rowCount = 2.
388 'event_id' => $this->_eventID
,
391 $participant = $this->callAPISuccess('participant', 'get', $params);
393 $this->assertEquals($participant['count'], 2);
397 * Test search by lead booker (registered by ID)
399 public function testSearchByRegisteredById() {
401 'registered_by_id' => $this->_participantID
,
403 $participant = $this->callAPISuccess('participant', 'get', $params);
405 $this->assertEquals($participant['count'], 1);
406 $this->assertEquals($participant['id'], $this->_participantID2
);
409 ///////////////// civicrm_participant_create methods
412 * Test civicrm_participant_create with empty params.
414 public function testCreateEmptyParams() {
416 $result = $this->callAPIFailure('participant', 'create', $params);
420 * Check with event_id.
422 public function testCreateMissingContactID() {
423 $this->callAPIFailure('participant', 'create', ['event_id' => $this->_eventID
]);
427 * Check with contact_id.
430 public function testCreateMissingEventID() {
431 $this->callAPIFailure('participant', 'create', ['contact_id' => $this->_contactID
]);
435 * Check with contact_id & event_id
437 public function testCreateEventIdOnly() {
439 'contact_id' => $this->_contactID
,
440 'event_id' => $this->_eventID
,
442 $participant = $this->callAPISuccess('participant', 'create', $params);
443 $this->getAndCheck($params, $participant['id'], 'participant');
447 * Check with complete array.
449 public function testCreateAllParams() {
450 $params = $this->_params
;
452 $participant = $this->callAPISuccess('participant', 'create', $params);
453 $this->_participantID
= $participant['id'];
454 // assertDBState compares expected values in $match to actual values in the DB
455 $this->assertDBState('CRM_Event_DAO_Participant', $participant['id'], $params);
459 * Test to check if receive date is being changed per CRM-9763
461 public function testCreateUpdateReceiveDate() {
462 $participant = $this->callAPISuccess('participant', 'create', $this->_params
);
464 'id' => $participant['id'],
467 $this->callAPISuccess('participant', 'create', $update);
468 $this->getAndCheck(array_merge($this->_params
, $update), $participant['id'], 'participant');
472 * Test to check if participant fee level is being changed per CRM-9781
474 public function testCreateUpdateParticipantFeeLevel() {
475 $myParams = $this->_params +
array('participant_fee_level' => CRM_Core_DAO
::VALUE_SEPARATOR
. "fee" . CRM_Core_DAO
::VALUE_SEPARATOR
);
476 $participant = $this->callAPISuccess('participant', 'create', $myParams);
478 'id' => $participant['id'],
481 $update = $this->callAPISuccess('participant', 'create', $update);
483 $this->assertEquals($participant['values'][$participant['id']]['fee_level'],
484 $update['values'][$participant['id']]['fee_level']
487 $this->callAPISuccess('participant', 'delete', array('id' => $participant['id']));
491 * Test the line items for participant fee with multiple price field values.
493 public function testCreateParticipantLineItems() {
494 // Create a price set for this event.
496 $priceset = $this->callAPISuccess('PriceSet', 'create', array(
497 'name' => 'my_price_set',
498 'title' => 'My Price Set',
501 'financial_type_id' => 4,
502 // 'entity' => array('civicrm_event' => array($this->_eventID)),
505 // Add the price set to the event with another API call.
506 // I tried to do this at once, but it did not work.
508 $priceset = $this->callAPISuccess('PriceSet', 'create', array(
509 'entity_table' => 'civicrm_event',
510 'entity_id' => $this->_eventID
,
511 'id' => $priceset['id'],
514 $pricefield = $this->callAPISuccess('PriceField', 'create', array(
515 'price_set_id' => $priceset['id'],
516 'name' => 'mypricefield',
517 'label' => 'My Price Field',
518 'html_type' => 'Text',
520 'is_display_amounts' => 1,
524 $pfv1 = $this->callAPISuccess('PriceFieldValue', 'create', array(
525 'price_field_id' => $pricefield['id'],
526 'name' => 'pricefieldvalue1',
527 'label' => 'pricefieldvalue1',
530 'financial_type_id' => 4,
533 $pfv2 = $this->callAPISuccess('PriceFieldValue', 'create', array(
534 'price_field_id' => $pricefield['id'],
535 'name' => 'pricefieldvalue2',
536 'label' => 'pricefieldvalue2',
539 'financial_type_id' => 4,
542 // pay 2 times price field value 1, and 2 times price field value 2.
543 $myParams = $this->_params +
array('participant_fee_level' => CRM_Core_DAO
::VALUE_SEPARATOR
. "pricefieldvalue1 - 2" . CRM_Core_DAO
::VALUE_SEPARATOR
. "pricefieldvalue2 - 2" . CRM_Core_DAO
::VALUE_SEPARATOR
);
544 $participant = $this->callAPISuccess('participant', 'create', $myParams);
546 // expect 2 line items.
547 $lineItems = $this->callAPISuccess('LineItem', 'get', array(
548 'entity_id' => $participant['id'],
549 'entity_table' => 'civicrm_participant',
552 $this->assertEquals(2, $lineItems['count']);
554 // Check quantity, label and unit price of lines.
555 // TODO: These assertions depend on the order of the line items, which is
556 // technically incorrect.
558 $lineItem = array_pop($lineItems['values']);
559 $this->assertEquals(2, $lineItem['qty']);
560 $this->assertEquals(5, $lineItem['unit_price']);
561 $this->assertEquals('pricefieldvalue2', $lineItem['label']);
563 $lineItem = array_pop($lineItems['values']);
564 $this->assertEquals(2, $lineItem['qty']);
565 $this->assertEquals(20, $lineItem['unit_price']);
566 $this->assertEquals('pricefieldvalue1', $lineItem['label']);
569 $this->callAPISuccess('participant', 'delete', array('id' => $participant['id']));
571 // TODO: I think the price set should be removed, but I don't know how
572 // to decouple it properly from the event. For the moment, I'll just comment
573 // out the lines below.
576 $this->callAPISuccess('PriceFieldValue', 'delete', array('id' => $pfv1['id']));
577 $this->callAPISuccess('PriceFieldValue', 'delete', array('id' => $pfv2['id']));
578 $this->callAPISuccess('PriceField', 'delete', array('id' => $pricefield['id']));
579 $this->callAPISuccess('PriceSet', 'delete', array('id' => $priceset['id']));
584 * Check with complete array.
586 public function testUpdate() {
587 $participantId = $this->participantCreate(array(
588 'contactID' => $this->_individualId
,
589 'eventID' => $this->_eventID
,
592 'id' => $participantId,
593 'contact_id' => $this->_individualId
,
594 'event_id' => $this->_eventID
,
597 'register_date' => '2006-01-21',
598 'source' => 'US Open',
600 $participant = $this->callAPISuccess('participant', 'create', $params);
601 $this->getAndCheck($params, $participant['id'], 'participant');
602 $result = $this->participantDelete($params['id']);
606 * Test to check if participant fee level is being changed per CRM-9781
607 * Try again without a custom separater to check that one isn't added
608 * (get & check won't accept an array)
610 public function testUpdateCreateParticipantFeeLevelNoSeparator() {
612 $myParams = $this->_params +
array('participant_fee_level' => "fee");
613 $participant = $this->callAPISuccess('participant', 'create', $myParams);
614 $this->assertAPISuccess($participant);
616 'id' => $participant['id'],
619 $this->callAPISuccess('participant', 'create', $update);
620 $this->assertEquals($participant['values'][$participant['id']]['fee_level'],
621 $myParams['participant_fee_level']
623 $this->getAndCheck($update, $participant['id'], 'participant');
625 ///////////////// civicrm_participant_update methods
628 * Test civicrm_participant_update with wrong params type.
630 public function testUpdateWrongParamsType() {
631 $params = 'a string';
632 $result = $this->callAPIFailure('participant', 'create', $params);
633 $this->assertEquals('Input variable `params` is not an array', $result['error_message']);
637 * Check with empty array.
639 public function testUpdateEmptyParams() {
641 $participant = $this->callAPIFailure('participant', 'create', $params);
642 $this->assertEquals($participant['error_message'], 'Mandatory key(s) missing from params array: event_id, contact_id');
646 * Check without event_id.
648 public function testUpdateWithoutEventId() {
649 $participantId = $this->participantCreate(array('contactID' => $this->_individualId
, 'eventID' => $this->_eventID
));
651 'contact_id' => $this->_individualId
,
654 'register_date' => '2006-01-21',
655 'source' => 'US Open',
656 'event_level' => 'Donation',
658 $participant = $this->callAPIFailure('participant', 'create', $params);
659 $this->assertEquals($participant['error_message'], 'Mandatory key(s) missing from params array: event_id');
660 // Cleanup created participant records.
661 $result = $this->participantDelete($participantId);
665 * Check with Invalid participantId.
667 public function testUpdateWithWrongParticipantId() {
672 'register_date' => '2006-01-21',
673 'source' => 'US Open',
674 'event_level' => 'Donation',
676 $participant = $this->callAPIFailure('Participant', 'update', $params);
680 * Check with Invalid ContactId.
682 public function testUpdateWithWrongContactId() {
683 $participantId = $this->participantCreate(array(
684 'contactID' => $this->_individualId
,
685 'eventID' => $this->_eventID
,
686 ), $this->_apiversion
);
688 'id' => $participantId,
689 'contact_id' => 12345,
692 'register_date' => '2006-01-21',
693 'source' => 'US Open',
694 'event_level' => 'Donation',
696 $participant = $this->callAPIFailure('participant', 'create', $params);
697 $result = $this->participantDelete($participantId);
700 ///////////////// civicrm_participant_delete methods
703 * Test civicrm_participant_delete with wrong params type.
705 public function testDeleteWrongParamsType() {
706 $params = 'a string';
707 $result = $this->callAPIFailure('participant', 'delete', $params);
711 * Test civicrm_participant_delete with empty params.
713 public function testDeleteEmptyParams() {
715 $result = $this->callAPIFailure('participant', 'delete', $params);
719 * Check with participant_id.
721 public function testParticipantDelete() {
723 'id' => $this->_participantID
,
725 $participant = $this->callAPISuccess('participant', 'delete', $params);
726 $this->assertAPISuccess($participant);
727 $this->assertDBState('CRM_Event_DAO_Participant', $this->_participantID
, NULL, TRUE);
731 * Check without participant_id.
733 * This should return an error because required param is missing..
735 public function testParticipantDeleteMissingID() {
737 'event_id' => $this->_eventID
,
739 $participant = $this->callAPIFailure('participant', 'delete', $params);
740 $this->assertNotNull($participant['error_message']);
744 * Delete with a get - a 'criteria delete'
746 public function testNestedDelete() {
747 $description = "Criteria delete by nesting a GET & a DELETE.";
748 $subfile = "NestedDelete";
749 $participants = $this->callAPISuccess('Participant', 'Get', array());
750 $this->assertEquals($participants['count'], 3);
751 $params = array('contact_id' => $this->_contactID2
, 'api.participant.delete' => 1);
752 $this->callAPIAndDocument('Participant', 'Get', $params, __FUNCTION__
, __FILE__
, $description, $subfile);
753 $check = $this->callAPISuccess('participant', 'getcount', array());
754 $this->assertEquals(1, $check, "only one participant should be left");
758 * Test creation of a participant with an associated contribution.
760 public function testCreateParticipantWithPayment() {
761 $description = "Single function to create contact with partipation & contribution.
762 Note that in the case of 'contribution' the 'create' is implied (api.contribution.create)";
763 $subfile = "CreateParticipantPayment";
765 'contact_type' => 'Individual',
766 'display_name' => 'dlobo',
767 'api.participant' => array(
768 'event_id' => $this->_eventID
,
771 'format.only_id' => 1,
773 'api.contribution.create' => array(
774 'financial_type_id' => 1,
775 'total_amount' => 100,
776 'format.only_id' => 1,
778 'api.participant_payment.create' => array(
779 'contribution_id' => '$value.api.contribution.create',
780 'participant_id' => '$value.api.participant',
784 $result = $this->callAPIAndDocument('contact', 'create', $params, __FUNCTION__
, __FILE__
, $description, $subfile);
785 $this->assertEquals(1, $result['values'][$result['id']]['api.participant_payment.create']['count']);
786 $this->callAPISuccess('contact', 'delete', array('id' => $result['id']));
790 * Test participant invoke post hook after status update.
792 public function testPostHookForAdditionalParticipant() {
793 $participantID = $this->participantCreate(array(
794 'contact_id' => $this->_contactID
,
796 'event_id' => $this->_eventID
,
798 $participantID2 = $this->participantCreate(array(
799 'contact_id' => $this->_contactID2
,
800 'event_id' => $this->_eventID
,
802 'registered_by_id' => $participantID,
805 $this->hookClass
->setHook('civicrm_post', array($this, 'onPost'));
807 'id' => $participantID,
810 $this->callAPISuccess('Participant', 'create', $params);
812 $result = $this->callAPISuccess('Participant', 'get', array('source' => 'Post Hook Update'));
813 $this->assertEquals(2, $result['count']);
815 $expected = array($participantID, $participantID2);
816 $actual = array_keys($result['values']);
817 $this->checkArrayEquals($expected, $actual);