function DevelMailLogTest::testDevelMailLogDefaultBackend

Same name in other branches
  1. 4.x tests/src/Kernel/DevelMailLogTest.php \Drupal\Tests\devel\Kernel\DevelMailLogTest::testDevelMailLogDefaultBackend()

Tests devel_mail_log plugin as default mail backend.

File

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

Class

DevelMailLogTest
Tests sending mails with debug interface.

Namespace

Drupal\Tests\devel\Kernel

Code

public function testDevelMailLogDefaultBackend() : void {
    // Configure devel_mail_log as default mail backends.
    $this->setDevelMailLogAsDefaultBackend();
    // Ensures that devel_mail_log is the default mail plugin .
    $mail_backend = $this->mailManager
        ->getInstance([
        'module' => 'default',
        'key' => 'default',
    ]);
    $this->assertInstanceOf(DevelMailLog::class, $mail_backend);
    $mail_backend = $this->mailManager
        ->getInstance([
        'module' => 'somemodule',
        'key' => 'default',
    ]);
    $this->assertInstanceOf(DevelMailLog::class, $mail_backend);
}