Part of meta issue #500866: [META] remove t() from assert message focused on the Simpletest module.
In D8 per http://drupal.org/simpletest-tutorial-drupal7#t, best practice is to remove t() from assert messages in tests. When necessary, t() should be replaced with format_string().
There are approximately 35 changes needed in 4 Test files. This issue includes conversion of all format_patch() occurances as well.
Comment | File | Size | Author |
---|---|---|---|
#13 | 1797514-13-simpletest-t.patch | 12.51 KB | dcam |
#6 | 1797514-6-simpletest-remove-t.patch | 12.86 KB | Gaelan |
#2 | 1797514-2-t-simpletest.patch | 13.96 KB | Lars Toomre |
Comments
Comment #1
Lars Toomre CreditAttribution: Lars Toomre commentedPatch forthcoming for this one!
Comment #2
Lars Toomre CreditAttribution: Lars Toomre commentedHere is an initial untested patch. This includes some format_string() changes.
Comment #3
jhodgdonSee also #1803674: Remove t() from default test assertions in TestBase class
Comment #4
dcam CreditAttribution: dcam commented#2 no longer applies due to changes in SimpleTestTest.php.
Comment #5
Lars Toomre CreditAttribution: Lars Toomre commentedComment #6
Gaelan CreditAttribution: Gaelan commentedRe-roll.
Comment #7
Gaelan CreditAttribution: Gaelan commentedI am forgetful! :(
Comment #8
Gaelan CreditAttribution: Gaelan commentedTag
Comment #9
dcam CreditAttribution: dcam commentedI reviewed the patch in #6 and it looks good to me. I didn't find any additional t()'s around assert messages.
Comment #9.0
dcam CreditAttribution: dcam commentedAdded counts from initial patch.
Comment #10
webchickTagging coding standards for Jennifer to take a look at.
Comment #11
jhodgdonThanks! Committed to 8.x. Ready for port!
Comment #12
dcam CreditAttribution: dcam commentedTagging as Novice.
Comment #13
dcam CreditAttribution: dcam commentedBackported #6 to D7.
Comment #14
disasm CreditAttribution: disasm commented#13: 1797514-13-simpletest-t.patch queued for re-testing.
Comment #15
disasm CreditAttribution: disasm commentedReviewed this patch. It just replaces t() with a plain string for static messages and format_string() for dynamic messages. marking RTBC. I also verified it applies to a clean 7.x.
Comment #16
dcam CreditAttribution: dcam commented@disasm: Thanks for the review! It will be nice to get one of these committed and closed!
Comment #17
jhodgdonThanks everyone! Another one bites the dust. Committed to 7.x.
Comment #18.0
(not verified) CreditAttribution: commentedFix summary to say Simpletest instead of Statistics.