Remove remaining uses of t() in assertEquals() calls

Created on 28 January 2023, over 1 year ago
Updated 3 January 2024, 6 months ago

Problem/Motivation

There is no need to use t() in tests, unless we're testing translations, however in core we do not follow this consistently, which does not set a good example for new contributions.

In ๐Ÿ“Œ [meta] Remove usage of t() in tests not testing translation Active we identified there are severals of calls to t() in calls to assertEqual() and assertEquals() and that removing all these in one go seems to be a suitable way of attacking this problem.

Proposed resolution

Generate a list of test files using t() and scan that list of files to find the ones to change.
find core -type f -iname '*Test.php' | xargs grep '[^a-zA-Z]t(' > remove_t_list.txt

Or, this should find the files.
find core -type f -iname '*Test.php' | xargs grep '[^a-zA-Z]t(' | grep assertE | awk -F: '{print $1}' | sort -u | nl

Remove any usages of t() if the test is not testing the translation system.

Remaining tasks

Patch
Review
Commit

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ“Œ Task
Status

Fixed

Version

10.2 โœจ

Component
Otherย  โ†’

Last updated about 4 hours ago

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom longwave UK

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

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.69.0 2024