Interactive installer tests cause emails to be sent out

Created on 3 May 2014, over 10 years ago
Updated 13 August 2023, over 1 year ago

Problem

  1. Interactive installer tests are starting off a clean slate; there is no settings.php that would replace the mail handler with a mail collector.

  2. Every interactive installer test (InstallerTestBase) actually sends out an email to admin@example.com.

Proposed solution

  1. We do not want to add a settings.php, because that would tamper the #1 test case of installer tests in which no settings.php exists yet.

  2. Instead, work around the problem in the installer itself to not send out an email when operating in a test site environment:

    if (!DRUPAL_TEST_IN_CHILD_SITE) {
      send_mail();
    }
    
  3. That way, we can still test an empty installer environment — we only cannot test that the installer sends out an e-mail, but that's an acceptable trade-off.

🐛 Bug report
Status

Closed: outdated

Version

9.5

Component
PHPUnit 

Last updated about 15 hours ago

Created by

🇩🇪Germany sun Karlsruhe

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024