function MailTest::configureDefaultMailInterface

Same name in other branches
  1. 9 core/modules/system/tests/src/Kernel/Mail/MailTest.php \Drupal\Tests\system\Kernel\Mail\MailTest::configureDefaultMailInterface()
  2. 8.9.x core/modules/system/tests/src/Kernel/Mail/MailTest.php \Drupal\Tests\system\Kernel\Mail\MailTest::configureDefaultMailInterface()
  3. 11.x 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 390

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.