Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Use function t() on tests
Proposed resolution
Use $this->t() of StringTranslationTrait on tests
Comment | File | Size | Author |
---|---|---|---|
#7 | token-simpletest-3061605-8-interdiff.txt | 478 bytes | Berdir |
#7 | token-simpletest-3061605-8.patch | 11.57 KB | Berdir |
| |||
#6 | token-simpletest-3061605-6.patch | 11.1 KB | Berdir |
Comments
Comment #2
BerdirNever heard of that rule?
In most cases, t() in tests can simply be removed.
Comment #3
thallesI thought it was strange, but the phpps pointed this out, see:
Comment #4
thallesI thought it was strange, but the phpps pointed this out, see:
Comment #5
BerdirAh, I see, that's because it just does that for all classes, no matter what, and these are old simpletest that live in the src folder. It would like stop doing that if they were in tests/src as phpunit tests, which is the real action that needs to be done.
Plus, in 99% of the cases, t() can just be removed in tests. But better not in the same issue.
Comment #6
BerdirThis was a relatively easy one.
Comment #7
BerdirComment #8
BerdirCommitted.