You are here

protected function EasyEmailTestBase::setUp in Easy Email 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Functional/EasyEmailTestBase.php \Drupal\Tests\easy_email\Functional\EasyEmailTestBase::setUp()

Overrides BrowserTestBase::setUp

File

tests/src/Functional/EasyEmailTestBase.php, line 55

Class

EasyEmailTestBase
Class EasyEmailTestBase

Namespace

Drupal\Tests\easy_email\Functional

Code

protected function setUp() {
  parent::setUp();

  // Redirect all emails to the test_mail_collector.
  // This is normally done in testing automatically, but we have MailSystem
  // installed.
  $this
    ->config('mailsystem.settings')
    ->set('defaults', [
    'sender' => 'test_mail_collector',
    'formatter' => 'swiftmailer',
  ])
    ->save();
  $this
    ->config('mailsystem.settings')
    ->set('modules', [])
    ->save();
  $this
    ->config('swiftmailer.message')
    ->set('generate_plain', FALSE)
    ->save();
  $this->adminUser = $this
    ->drupalCreateUser($this
    ->getAdministratorPermissions());
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->createHtmlTextFormat();
  $this
    ->drupalLogout();
  $this->adminUser = $this
    ->drupalCreateUser($this
    ->getAdministratorPermissions());
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->initBrowserOutputFile();
}