As noted on:
asserts should not have calls to t().
When working on:
#1483662: URLs for drupal.org module help pages need updates
we noticed that there are calls to t() inside asserts in help.test.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | Remove_t_from_help_test-1497240-4.patch | 2.1 KB | realityloop |
| #1 | Remove_t_from_help_test-1497240-1.patch | 2.98 KB | mojolama |
Comments
Comment #1
mojolama commentedChanged about 8 lines in help.test for 8.x.
Did a search on "assert" and removed all instances of t() from those lines.
Comment #2
tayzlor commentedTried patch out, applies cleanly and tests ran successfully.
Comment #3
robloachNeeds an update though.
Comment #4
realityloop commentedrerolled
Comment #5
realityloop commentedComment #6
realityloop commentedComment #7
dawehnerJust in general we should think whether it is okay to also remove the t() from the expected value,
though for the actual message this is perfect.
Comment #8
manumilou commentedPatch #4 applies nicely, tests passed.
Comment #9
star-szrI don't think these should be changed, it's assertion messages that we don't want in t(), like @dawehner said.
Assertion messages: 'Help intro text correctly appears.', 'Help topics text correctly appears.'.
See #500866: [META] remove t() from assert message. Leaving status for now but this should probably be closed.
Comment #10
catchYes t() is OK in those situations - it's comparing a translated string with a translated string, not an assertion message.