MNT Unit test for directory seperator on windows

This commit is contained in:
Steve Boyd 2021-02-21 21:53:36 +13:00 committed by Maxime Rainville
parent 3993f019e9
commit 6794aa7cd3

View File

@ -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());
}
}