Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294458

[meta] Remove usage of t() in tests not testing translation

$
0
0

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.

A rough estimation, adapted from that one of @longwave, shows that here are 4247 instances of this as of 22b08be669260979ec6a45676b16be79c89719eb:

$ find core -type f -iname '*Test.php' | xargs grep '[^a-zA-Z]t(' | wc -l
4247

We will need to ensure to leave t() where the test actually tests the translation system.

Proposed resolution

Scan through the list generaged by find core -type f -iname '*Test.php' | xargs grep '[^a-zA-Z]t('> remove_t_list.txt
Remove any usages of t() if the test is not testing the translation system.

Remaining tasks

  1. Get confirmation about the scope from committer(s) - split up the task by core module or subsystem or something else?
  2. Do it.
  3. Review it.
  4. Commit it.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

N/A


Viewing all articles
Browse latest Browse all 294458

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>