/
maxavangard
/
KTC
Обзор
Документация
Войти
/
maxavangard
/
KTC
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
tests/Support/MailerBootstrap.php
28 строк
800 B
Avangartd
first_commit
28 июн 2026, 18:48
28 июн 2026, 18:48
f36fb03
Код
Авторство
О чём код?
<?php declare(strict_types=1); namespace app\tests\Support; use Yii; use yii\base\Application; use yii\base\BootstrapInterface; use yii\mail\MailerInterface; /** * Registers the application mailer component as the DI container singleton for {@see MailerInterface}. * * Codeception replaces `components.mailer` with its own TestMailer to capture sent emails. * Since the DI container is configured before the mailer mock, this bootstrap ensures * the DI singleton resolves to the same mailer instance used by the application. */ final class MailerBootstrap implements BootstrapInterface { /** * @param Application $app Application instance. */ public function bootstrap($app): void { Yii::$container->setSingleton(MailerInterface::class, $app->mailer); } }