From 5e2486188af16ef2f0f52d992fd466efe9c286d6 Mon Sep 17 00:00:00 2001 From: Robert Ragas Date: Tue, 22 Aug 2023 15:03:20 +0200 Subject: [PATCH] clean up policy plugin for mailer log after running tests --- tests/behat/features/bootstrap/EmailContext.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/behat/features/bootstrap/EmailContext.php b/tests/behat/features/bootstrap/EmailContext.php index 3c96e37a516..31c25cfb1a5 100644 --- a/tests/behat/features/bootstrap/EmailContext.php +++ b/tests/behat/features/bootstrap/EmailContext.php @@ -59,6 +59,13 @@ public function disableEmailSpool() { MailerTransport::load($default_id)->setAsDefault(); \Drupal::state()->delete('default_mailer_transport'); } + + // Remove the mail logger plugin to the default policy. + $default_mailer_policy = MailerPolicy::load('_'); + $mailer_configuration = $default_mailer_policy->getConfiguration(); + unset($mailer_configuration['log_mail']); + $default_mailer_policy->setConfiguration($mailer_configuration); + $default_mailer_policy->save(); } /**