You are here

protected function MailTest::configureDefaultMailInterface in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Kernel/Mail/MailTest.php \Drupal\Tests\system\Kernel\Mail\MailTest::configureDefaultMailInterface()

Configures the default mail interface.

KernelTestBase enforces the usage of 'test_mail_collector' plugin to collect mail. Since we need to test this functionality itself, we manually configure the default mail interface.

@todo Refactor in https://www.drupal.org/project/drupal/issues/3076715

Parameters

string $mail_interface: The mail interface to configure.

4 calls to MailTest::configureDefaultMailInterface()
MailTest::testConvertRelativeUrlsIntoAbsolute in core/modules/system/tests/src/Kernel/Mail/MailTest.php
Checks that relative paths in mails are converted into absolute URLs.
MailTest::testErrorMessageDisplay in core/modules/system/tests/src/Kernel/Mail/MailTest.php
Assert that the pluggable mail system is functional.
MailTest::testPluggableFramework in core/modules/system/tests/src/Kernel/Mail/MailTest.php
Assert that the pluggable mail system is functional.
MailTest::testRenderedElementsUseAbsolutePaths in core/modules/system/tests/src/Kernel/Mail/MailTest.php
Checks that mails built from render arrays contain absolute paths.

File

core/modules/system/tests/src/Kernel/Mail/MailTest.php, line 376

Class

MailTest
Performs tests on the pluggable mailing framework.

Namespace

Drupal\Tests\system\Kernel\Mail

Code

protected function configureDefaultMailInterface($mail_interface) {
  $GLOBALS['config']['system.mail']['interface']['default'] = $mail_interface;
}