-
Notifications
You must be signed in to change notification settings - Fork 225
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 #1042 from creative-commoners/pulls/5.8/dir-sepera…
…tor-windows-unit-test MNT Unit test for directory seperator on windows
- Loading branch information
Showing
1 changed file
with
16 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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
use SilverStripe\CMS\Model\SiteTree; | ||
use SilverStripe\Dev\SapphireTest; | ||
use SilverStripe\UserForms\Model\Recipient\EmailRecipient; | ||
use SilverStripe\UserForms\Model\UserDefinedForm; | ||
|
||
class EmailRecipientTest extends SapphireTest | ||
{ | ||
|
@@ -50,4 +51,19 @@ public function testEmailAddressesTrimmed() | |
$this->assertSame('[email protected]', $recipient->EmailFrom); | ||
$this->assertSame('[email protected]', $recipient->EmailReplyTo); | ||
} | ||
|
||
public function testGetEmailTemplateDropdownValues() | ||
{ | ||
$form = new UserDefinedForm(); | ||
$form->write(); | ||
$recipient = new EmailRecipient(); | ||
$recipient->FormID = $form->ID; | ||
$recipient->FormClass = UserDefinedForm::class; | ||
$ds = DIRECTORY_SEPARATOR; | ||
$expected = [ | ||
"email{$ds}SubmittedFormEmail" => 'SubmittedFormEmail', | ||
"email{$ds}SubmittedFormEmailPlain" => 'SubmittedFormEmailPlain' | ||
]; | ||
$this->assertSame($expected, $recipient->getEmailTemplateDropdownValues()); | ||
} | ||
} |