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.
Summary
dataProviderMailCollector()intests/phpunit/Drupal/SwitchableSettingsTest.phplabels theENVIRONMENT_STAGEcase as// Stage: delivered to the original recipients.(line 1139). That statement no longer matches the behaviour ofsettings.reroute_email.php.Details
Commit
909660bd("[#3098] Enabled email rerouting in every cloud environment and moved 'reroute_email' to the development modules script.", #3099) changedweb/sites/default/includes/modules/settings.reroute_email.phpso rerouting is enabled for every environment that is notENVIRONMENT_LOCAL,ENVIRONMENT_CIorENVIRONMENT_PROD:That commit updated the stage expectation in
dataProviderRerouteEmail()toenable => TRUE, and updatedtestEnvironmentAcquiaStage()andtestEnvironmentLagoonTest()inEnvironmentSettingsTest.phpto match. The descriptive comment indataProviderMailCollector()was not updated in the same pass, so it still describes the pre-909660bdbehaviour.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 neighbouringENVIRONMENT_DEVentry (line 1121), which reads// Dev: rerouted, then delivered to the rerouting address.even though dev and stage now take the same branch.Suggested change
The
ENVIRONMENT_PRODentry directly below it keeps// Prod: delivered to the original recipients., which remains accurate.Notes
Found while porting
909660bdinto 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.