-
-
Notifications
You must be signed in to change notification settings - Fork 823
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31627 from totten/master-phpunit10-action
PHPUnit 10 - Various fix for scheduled-reminder tests (et al)
- Loading branch information
Showing
6 changed files
with
61 additions
and
28 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 |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
+--------------------------------------------------------------------+ | ||
*/ | ||
|
||
use Civi\ActionSchedule\AbstractMappingTest; | ||
use Civi\ActionSchedule\AbstractMappingTestCase; | ||
|
||
/** | ||
* Class CRM_Event_ActionMappingTest | ||
|
@@ -18,25 +18,56 @@ | |
* This class tests various configurations of event scheduled-reminders. It follows a design/pattern described in | ||
* AbstractMappingTest. | ||
* | ||
* @see \Civi\ActionSchedule\AbstractMappingTest | ||
* @see \Civi\ActionSchedule\AbstractMappingTestCase | ||
* @group headless | ||
*/ | ||
class CRM_Event_ActionMappingTest extends AbstractMappingTest { | ||
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
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