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.

Files: 
CommentFileSizeAuthor
#13 1797514-13-simpletest-t.patch12.51 KBdcam
PASSED: [[SimpleTest]]: [MySQL] 40,117 pass(es). View
#6 1797514-6-simpletest-remove-t.patch12.86 KBGaelan
PASSED: [[SimpleTest]]: [MySQL] 48,760 pass(es). View
#2 1797514-2-t-simpletest.patch13.96 KBLars Toomre
PASSED: [[SimpleTest]]: [MySQL] 41,904 pass(es). View

Comments

Lars Toomre’s picture

Assigned: xjm » Lars Toomre

Patch forthcoming for this one!

Lars Toomre’s picture

Status: Active » Needs review
FileSize
13.96 KB
PASSED: [[SimpleTest]]: [MySQL] 41,904 pass(es). View

Here is an initial untested patch. This includes some format_string() changes.

jhodgdon’s picture

dcam’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

#2 no longer applies due to changes in SimpleTestTest.php.

Lars Toomre’s picture

Assigned: Lars Toomre » Unassigned
Gaelan’s picture

FileSize
12.86 KB
PASSED: [[SimpleTest]]: [MySQL] 48,760 pass(es). View

Re-roll.

Gaelan’s picture

Status: Needs work » Needs review

I am forgetful! :(

Gaelan’s picture

Issue tags: -Needs reroll

Tag

dcam’s picture

Status: Needs review » Reviewed & tested by the community

I reviewed the patch in #6 and it looks good to me. I didn't find any additional t()'s around assert messages.

dcam’s picture

Issue summary: View changes

Added counts from initial patch.

webchick’s picture

Issue tags: +coding standards

Tagging coding standards for Jennifer to take a look at.

jhodgdon’s picture

Version: 8.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Thanks! Committed to 8.x. Ready for port!

dcam’s picture

Issue tags: +Novice

Tagging as Novice.

dcam’s picture

Status: Patch (to be ported) » Needs review
FileSize
12.51 KB
PASSED: [[SimpleTest]]: [MySQL] 40,117 pass(es). View

Backported #6 to D7.

disasm’s picture

#13: 1797514-13-simpletest-t.patch queued for re-testing.

disasm’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed 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.

dcam’s picture

@disasm: Thanks for the review! It will be nice to get one of these committed and closed!

jhodgdon’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone! Another one bites the dust. Committed to 7.x.

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Fix summary to say Simpletest instead of Statistics.