WebformHandlerEmailTwigTest.php in Webform 8.5
File
tests/src/Functional/Handler/WebformHandlerEmailTwigTest.php
View source
<?php
namespace Drupal\Tests\webform\Functional\Handler;
use Drupal\webform\Entity\Webform;
use Drupal\Tests\webform\Functional\WebformBrowserTestBase;
class WebformHandlerEmailTwigTest extends WebformBrowserTestBase {
protected static $testWebforms = [
'test_handler_email_twig',
];
public function testEmailTwigHandler() {
$webform = Webform::load('test_handler_email_twig');
$this
->postSubmission($webform);
$sent_email = $this
->getLastEmail();
$this
->assertEqual($sent_email['params']['body'], '<p>Submitted values are:</p>
<b>First name</b><br />John<br /><br />
<b>Last name</b><br />Smith<br /><br />
<b>Email</b><br /><a href="mailto:from@example.com">from@example.com</a><br /><br />
<b>Subject</b><br />{subject}<br /><br />
<b>Message</b><br />{message}<br /><br />');
}
}