function TransportTest::setUpMailerDsnConfigOverride

Sets up a mailer DSN config override.

Parameters

string $scheme: The mailer DSN scheme.

string $host: The mailer DSN host.

string|null $user: The mailer DSN username.

string|null $password: The mailer DSN password.

int|null $port: The mailer DSN port.

array<string, mixed> $options: Options for the mailer transport.

6 calls to TransportTest::setUpMailerDsnConfigOverride()
TransportTest::resetMailerDsnConfigOverride in core/modules/mailer/tests/src/Kernel/TransportTest.php
Resets a mailer DSN config override.
TransportTest::testBuiltinFactory in core/modules/mailer/tests/src/Kernel/TransportTest.php
@dataProvider providerTestBuiltinFactory @covers ::createTransport
TransportTest::testMissingFactory in core/modules/mailer/tests/src/Kernel/TransportTest.php
@covers ::createTransport
TransportTest::testSendmailFactoryAllowedCommand in core/modules/mailer/tests/src/Kernel/TransportTest.php
@covers ::createTransport @covers \Drupal\Core\Mailer\Transport\SendmailCommandValidationTransportFactory::create
TransportTest::testSendmailFactoryUnlistedCommand in core/modules/mailer/tests/src/Kernel/TransportTest.php
@covers ::createTransport @covers \Drupal\Core\Mailer\Transport\SendmailCommandValidationTransportFactory::create

... See full list

File

core/modules/mailer/tests/src/Kernel/TransportTest.php, line 45

Class

TransportTest
Tests the transport factory service.

Namespace

Drupal\Tests\mailer\Kernel

Code

protected function setUpMailerDsnConfigOverride(string $scheme, string $host, ?string $user = NULL, ?string $password = NULL, ?int $port = NULL, array $options = []) : void {
    $GLOBALS['config']['system.mail']['mailer_dsn'] = [
        'scheme' => $scheme,
        'host' => $host,
        'user' => $user,
        'password' => $password,
        'port' => $port,
        'options' => $options,
    ];
}

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