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(); } /**