Problem/Motivation
On the "next minor" Drupal core matrix, 8 assertions in Drupal\Tests\purge_users\Functional\NotificationTest fail because core now emits the mail Content-Type header with a lowercase charset=utf-8:
- Expected (fixtures):
text/plain; charset=UTF-8; format=flowed; delsp=yes - Actual (next minor):
text/plain; charset=utf-8; format=flowed; delsp=yes
Root cause in core: [#3555537] Use charset=utf-8 instead of charset=UTF-8 in content type headers (follow-up of Symfony PR #60685). Charset tokens are case-insensitive per RFC 2045, so the change is semantically equivalent.
Example failing job on the 4.x MR !58 pipeline: job #9457656. The same failures will also appear on 5.x once core releases the next minor.
Steps to reproduce
Run NotificationTest against a Drupal core version that contains commit 1dc33e4b04 (core #3555537, landed on 11.x-dev).
Proposed resolution
Normalize the mail Content-Type header case-insensitively before comparing, so the tests pass on both the current stable and the next minor. Two options:
- Lowercase the charset token in both expected and actual before
assertEquals(), e.g. in a small helper inNotificationTest. - Stop relying on full-array equality for the email and assert each header individually, using a case-insensitive comparison for
Content-Type.
Option 1 is the smallest change. Affected fixtures in tests/src/Functional/NotificationTest.php: lines 644, 684, 721 on 5.x (same strings in 4.x).
Remaining tasks
- Implement the normalization helper.
- Verify tests pass on both the current stable (uppercase) and the next minor (lowercase) matrices.
- Apply on 5.x, backport to 4.x.
Release notes snippet
NotificationTest is now tolerant to the lowercase charset=utf-8 emitted by Drupal core ≥ 11.x-dev (core #3555537).
Issue fork purge_users-3586102
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #6
mably commented