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:
Maxime Rainville 2021-04-14 11:26:16 +12:00 committed by GitHub
commit 2bd2ee9780
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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