You are here

public function DevelMailLogTest::testDevelMailLogDefaultBackend in Devel 8.2

Same name and namespace in other branches
  1. 8.3 tests/src/Kernel/DevelMailLogTest.php \Drupal\Tests\devel\Kernel\DevelMailLogTest::testDevelMailLogDefaultBackend()
  2. 8 tests/src/Kernel/DevelMailLogTest.php \Drupal\Tests\devel\Kernel\DevelMailLogTest::testDevelMailLogDefaultBackend()
  3. 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 48

Class

DevelMailLogTest
Tests sending mails with debug interface.

Namespace

Drupal\Tests\devel\Kernel

Code

public function testDevelMailLogDefaultBackend() {

  // 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);
}