function DevelMailLogTest::setDevelMailLogAsDefaultBackend

Same name in other branches
  1. 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 191

Class

DevelMailLogTest
Tests sending mails with debug interface.

Namespace

Drupal\Tests\devel\Kernel

Code

private function setDevelMailLogAsDefaultBackend() : void {
    // @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();
}