You are here

private function DevelMailLogTest::setDevelMailLogAsDefaultBackend in Devel 8.2

Same name and namespace in other branches
  1. 8.3 tests/src/Kernel/DevelMailLogTest.php \Drupal\Tests\devel\Kernel\DevelMailLogTest::setDevelMailLogAsDefaultBackend()
  2. 8 tests/src/Kernel/DevelMailLogTest.php \Drupal\Tests\devel\Kernel\DevelMailLogTest::setDevelMailLogAsDefaultBackend()
  3. 4.x tests/src/Kernel/DevelMailLogTest.php \Drupal\Tests\devel\Kernel\DevelMailLogTest::setDevelMailLogAsDefaultBackend()

Configure devel_mail_log as default mail backend.

2 calls to DevelMailLogTest::setDevelMailLogAsDefaultBackend()
DevelMailLogTest::testDevelMailLogDefaultBackend in tests/src/Kernel/DevelMailLogTest.php
Tests devel_mail_log plugin as default mail backend.
DevelMailLogTest::testDevelMailLogOutput in tests/src/Kernel/DevelMailLogTest.php
Tests devel mail log output.

File

tests/src/Kernel/DevelMailLogTest.php, line 189

Class

DevelMailLogTest
Tests sending mails with debug interface.

Namespace

Drupal\Tests\devel\Kernel

Code

private function setDevelMailLogAsDefaultBackend() {

  // TODO can this be avoided?
  // KernelTestBase enforce the usage of 'test_mail_collector' plugin for
  // collect the mails. Since we need to test devel mail plugin we manually
  // configure the mail implementation to use 'devel_mail_log'.
  $GLOBALS['config']['system.mail']['interface']['default'] = 'devel_mail_log';

  // Configure devel_mail_log as default mail backend.
  $this
    ->config('system.mail')
    ->set('interface.default', 'devel_mail_log')
    ->save();
}