-
-
Notifications
You must be signed in to change notification settings - Fork 825
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add actionschedule test for activity tokens
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,6 +112,8 @@ public function setUp(): void { | |
'activity_date_time' => '20120615100000', | ||
'is_current_revision' => 1, | ||
'is_deleted' => 0, | ||
'subject' => 'Phone call', | ||
'details' => 'A phone call about a bear', | ||
]; | ||
$this->fixtures['contact'] = [ | ||
'is_deceased' => 0, | ||
|
@@ -957,6 +959,27 @@ public function mailerExamples(): array { | |
], | ||
]; | ||
|
||
// In this example, we test activity tokens | ||
$activityTokens = '{activity.subject};;{activity.details};;{activity.activity_date_time}'; | ||
$activity = $this->fixtures['phonecall']; | ||
$activityTokensExpected = "Phone call;;A phone call about a bear;;June 15th, 2012 10:00 AM"; | ||
$cases[4] = [ | ||
// Schedule definition. | ||
[ | ||
'subject' => "subj $someTokensTmpl", | ||
'body_html' => "html {$activityTokens}", | ||
'body_text' => "text {$activityTokens}", | ||
], | ||
// Assertions (regex). | ||
[ | ||
'from_name' => '/^FIXME$/', | ||
'from_email' => '/^[email protected]$/', | ||
'subject' => "/^subj $someTokensExpected\$/", | ||
'body_html' => "/^html $activityTokensExpected\$/", | ||
'body_text' => "/^text $activityTokensExpected\$/", | ||
], | ||
]; | ||
|
||
return $cases; | ||
} | ||
|
||
|
24bf3d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mattwire #20335 still needs a test. I never wrote one (and i'm not really a coder). Would the same approach work for the event & participant tokens?