-
-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ActionMappingTest - Update data-providers for phpunit 10
- Loading branch information
Showing
5 changed files
with
46 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,20 +23,51 @@ | |
*/ | ||
class CRM_Event_ActionMappingTest extends AbstractMappingTestCase { | ||
|
||
public function createTestCases() { | ||
public static function createTestCases(): array { | ||
$cs = []; | ||
|
||
$cs[] = [ | ||
'2015-02-01 00:00:00', | ||
'createReunion registerAliceDualRole scheduleForEventStart startWeekBefore targetByRole useHelloFirstName', | ||
[ | ||
[ | ||
'time' => '2015-01-25 00:00:00', | ||
'to' => ['[email protected]'], | ||
'subject' => '/Hello, Alice/', | ||
], | ||
], | ||
]; | ||
|
||
return $cs; | ||
} | ||
|
||
public function createReunion(array $params = [], string $identifier = 'event') { | ||
$this->eventCreateUnpaid([ | ||
'title' => 'Roadie Reunion', | ||
'start_date' => '2015-02-01 00:00:00', | ||
'end_date' => '2015-02-03 05:00:00', | ||
'registration_start_date' => '2014-08-01 09:00:00', | ||
'registration_end_date' => '2015-01-15 23:59:59', | ||
]); | ||
} | ||
|
||
public function testLimitByRoleID(): void { | ||
$this->participantCreate(['role_id' => [1, 2], 'event_id' => $this->eventCreateUnpaid()['id']]); | ||
public function registerAliceDualRole() { | ||
$this->participantCreate([ | ||
'role_id' => [1, 2], | ||
'contact_id' => $this->contacts['alice']['id'], | ||
'event_id' => $this->getEventID(), | ||
]); | ||
} | ||
|
||
public function scheduleForEventStart(): void { | ||
$this->schedule->mapping_id = CRM_Event_ActionMapping::EVENT_NAME_MAPPING_ID; | ||
$this->schedule->start_action_date = 'start_date'; | ||
$this->schedule->entity_value = $this->getEventID(); | ||
} | ||
|
||
public function targetByRole(): void { | ||
$this->schedule->limit_to = 1; | ||
$this->schedule->recipient_listing = 1; | ||
$this->startWeekBefore(); | ||
$this->useHelloFirstName(); | ||
$this->schedule->save(); | ||
$this->callAPISuccess('Job', 'send_reminder', []); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters