MailhandlerDemoWebTest.php in Mailhandler 8
File
mailhandler_demo/src/Tests/MailhandlerDemoWebTest.php
View source
<?php
namespace Drupal\mailhandler_demo\Tests;
use Drupal\simpletest\WebTestBase;
class MailhandlerDemoWebTest extends WebTestBase {
public static $modules = [
'mailhandler_demo',
];
public function setUp() {
parent::setUp();
$this->user = $this
->drupalCreateUser([
'access administration pages',
'administer inmail',
]);
$this
->drupalLogin($this->user);
}
protected function testMailhandlerDemoUi() {
$this
->drupalGet('admin/config/system/inmail/paste');
$sample_messages = (array) $this
->xpath('//*[@id="edit-example"]')[0]->option;
$this
->assertTrue(in_array('Mailhandler_PGP_Signed_MIME.eml', $sample_messages), 'PGP Signed MIME message is in the list of sample mail messages.');
$this
->assertTrue(in_array('Mailhandler_PGP_Signed_MIME_HTML.eml', $sample_messages), 'PGP Signed MIME HTML message is in the list of sample mail messages.');
$this
->assertTrue(in_array('Mailhandler_PGP_Signed_Inline.eml', $sample_messages), 'PGP Signed Inline message is in the list of sample mail messages.');
$this
->assertTrue(in_array('Mailhandler_Comment.eml', $sample_messages), 'Sample comment message is in the list of sample mail messages.');
}
}