Skip to content

Commit

Permalink
Merge pull request #26708 from eileenmcnaughton/part_create
Browse files Browse the repository at this point in the history
Use eventCreateUnpaid in participantCreate
  • Loading branch information
seamuslee001 authored Jul 3, 2023
2 parents ca52445 + dc3a687 commit a6fc7eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions tests/phpunit/CRM/Event/ActionMappingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
+--------------------------------------------------------------------+
*/

use Civi\ActionSchedule\AbstractMappingTest;

/**
* Class CRM_Event_ActionMappingTest
* @group ActionSchedule
Expand All @@ -19,24 +21,22 @@
* @see \Civi\ActionSchedule\AbstractMappingTest
* @group headless
*/
class CRM_Event_ActionMappingTest extends \Civi\ActionSchedule\AbstractMappingTest {
class CRM_Event_ActionMappingTest extends AbstractMappingTest {

public function createTestCases() {
}

public function testLimitByRoleId() {
$participantId = $this->participantCreate(['role_id' => [1, 2]]);
$participant = $this->callAPISuccess('participant', 'getsingle', ['id' => $participantId]);
$eventId = $participant['event_id'];
public function testLimitByRoleID(): void {
$this->participantCreate(['role_id' => [1, 2], 'event_id' => $this->eventCreateUnpaid()['id']]);
$this->schedule->mapping_id = CRM_Event_ActionMapping::EVENT_NAME_MAPPING_ID;
$this->schedule->start_action_date = 'start_date';
$this->schedule->entity_value = $eventId;
$this->schedule->entity_value = $this->getEventID();
$this->schedule->limit_to = 1;
$this->schedule->recipient_listing = 1;
$this->startWeekBefore();
$this->useHelloFirstName();
$this->schedule->save();
$this->callAPISuccess('job', 'send_reminder', []);
$this->callAPISuccess('Job', 'send_reminder', []);
}

}
2 changes: 1 addition & 1 deletion tests/phpunit/CiviTest/CiviUnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ public function participantCreate(array $params = []): int {
$this->ids['Contact']['participant'] = $params['contact_id'] = $this->individualCreate();
}
if (empty($params['event_id'])) {
$event = $this->eventCreate(['end_date' => 20081023, 'registration_end_date' => 20081015]);
$event = $this->eventCreateUnpaid(['end_date' => 20081023, 'registration_end_date' => 20081015]);
$params['event_id'] = $event['id'];
}
$defaults = [
Expand Down

0 comments on commit a6fc7eb

Please sign in to comment.