Skip to content

Commit

Permalink
Merge pull request #1042 from creative-commoners/pulls/5.8/dir-sepera…
Browse files Browse the repository at this point in the history
…tor-windows-unit-test

MNT Unit test for directory seperator on windows
  • Loading branch information
Maxime Rainville authored Apr 13, 2021
2 parents 3993f01 + 6794aa7 commit 2bd2ee9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/php/Model/Recipient/EmailRecipientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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());
}
}

0 comments on commit 2bd2ee9

Please sign in to comment.