mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Merge pull request #1042 from creative-commoners/pulls/5.8/dir-seperator-windows-unit-test
MNT Unit test for directory seperator on windows
This commit is contained in:
commit
2bd2ee9780
@ -5,6 +5,7 @@ namespace SilverStripe\UserForms\Tests\Model\Recipient;
|
||||
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 @@ class EmailRecipientTest extends SapphireTest
|
||||
$this->assertSame('test2@example.com', $recipient->EmailFrom);
|
||||
$this->assertSame('test3@example.com', $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());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user