Skip to content

Update stale stage mail comment in dataProviderMailCollector after enabling stage rerouting #3103

Description

@AlexSkrypnyk

Summary

dataProviderMailCollector() in tests/phpunit/Drupal/SwitchableSettingsTest.php labels the ENVIRONMENT_STAGE case as // Stage: delivered to the original recipients. (line 1139). That statement no longer matches the behaviour of settings.reroute_email.php.

Details

Commit 909660bd ("[#3098] Enabled email rerouting in every cloud environment and moved 'reroute_email' to the development modules script.", #3099) changed web/sites/default/includes/modules/settings.reroute_email.php so rerouting is enabled for every environment that is not ENVIRONMENT_LOCAL, ENVIRONMENT_CI or ENVIRONMENT_PROD:

if (in_array($settings['environment'], [ENVIRONMENT_LOCAL, ENVIRONMENT_CI, ENVIRONMENT_PROD], TRUE)) {
  $config['reroute_email.settings']['enable'] = FALSE;
}
else {
  $config['reroute_email.settings']['enable'] = TRUE;
}

That commit updated the stage expectation in dataProviderRerouteEmail() to enable => TRUE, and updated testEnvironmentAcquiaStage() and testEnvironmentLagoonTest() in EnvironmentSettingsTest.php to match. The descriptive comment in dataProviderMailCollector() was not updated in the same pass, so it still describes the pre-909660bd behaviour.

The assertion itself is correct and needs no change: stage genuinely does not use test_mail_collector. Only the comment is wrong, and it now contradicts the neighbouring ENVIRONMENT_DEV entry (line 1121), which reads // Dev: rerouted, then delivered to the rerouting address. even though dev and stage now take the same branch.

Suggested change

-    // Stage: delivered to the original recipients.
+    // Stage: rerouted, then delivered to the rerouting address.

The ENVIRONMENT_PROD entry directly below it keeps // Prod: delivered to the original recipients., which remains accurate.

Notes

Found while porting 909660bd into a consumer site. The same one-line correction has been applied downstream in drevops/website#330; raising it here so the template and its consumers stay in sync.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A2Working clone index A2

    Type

    No type

    Projects

    • Status
      Release queue

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions