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:

  1. Lowercase the charset token in both expected and actual before assertEquals(), e.g. in a small helper in NotificationTest.
  2. 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).

Command icon 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

mably created an issue. See original summary.

  • mably committed fdf0c0b3 on 4.x
    fix: #3586102 NotificationTest fails on next minor: Content-Type charset...

  • mably committed 6702e6ff on 5.x
    fix: #3586102 NotificationTest fails on next minor: Content-Type charset...
mably’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.