This is a sub-task of #500866: [META] remove t() from assert message focused on the File sub-system.

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().

This issue is to correct the File sub-system tests for the above. There are approximately 118 changes needed (including format_string() changes).

Files: 
CommentFileSizeAuthor
#10 1797296-10-t-file.patch106.02 KBdcam
PASSED: [[SimpleTest]]: [MySQL] 40,343 pass(es).
[ View ]
#7 1797296-7-t-file.patch9.41 KBLars Toomre
PASSED: [[SimpleTest]]: [MySQL] 42,819 pass(es).
[ View ]
#5 1797296-5-t-file.patch8.26 KBLars Toomre
PASSED: [[SimpleTest]]: [MySQL] 41,898 pass(es).
[ View ]
#1 t-assert-file-1797296-1.patch42.43 KBLars Toomre
PASSED: [[SimpleTest]]: [MySQL] 41,686 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new42.43 KB
PASSED: [[SimpleTest]]: [MySQL] 41,686 pass(es).
[ View ]

Here is an initial untested patch for this issue. This patch includes format_string() conversions as well.

Assigned:Unassigned» jhodgdon
Status:Needs review» Reviewed & tested by the community
Issue tags:+needs backport to D7

I reviewed all the changes locally; looks good. Sorry @jhodgdon for another email. :)

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

This one's in, thanks!

Assigned:jhodgdon» Unassigned

Title:Remove t() from asserts from File sub-system testsRemove t() from asserts from File system tests
Version:7.x-dev» 8.x-dev
Status:Patch (to be ported)» Needs review
StatusFileSize
new8.26 KB
PASSED: [[SimpleTest]]: [MySQL] 41,898 pass(es).
[ View ]

I was double checking all of the tests in the File system and see that a bunch were not included from one file: DirectoryTest.php. The attached patch converts those as well. I have confirmed that all other tests in File system are correct after this gets in.

Status:Needs review» Needs work

All of the changes in #5 look good, but I found a couple of stray t()'s around assert messages in UnmanagedCopyTest.php, lines 42, 86. Maybe they were added by a recent commit, I don't know. If they can get taken care of, then I'll make sure to re-test.

Status:Needs work» Needs review
StatusFileSize
new9.41 KB
PASSED: [[SimpleTest]]: [MySQL] 42,819 pass(es).
[ View ]

Here is a patch that builds on #5 and adds the two fixes from #6 as well. I am pretty sure both of those lines were changed in the past three weeks or so.

Status:Needs review» Reviewed & tested by the community

Thanks, @Lars Toomre! #7 looks good. I don't see any other t()'s in the system file tests.

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

Thanks! This is committed. I guess back to 7.x for porting of one or more of the above 8.x patches?

Status:Patch (to be ported)» Needs review
StatusFileSize
new106.02 KB
PASSED: [[SimpleTest]]: [MySQL] 40,343 pass(es).
[ View ]

Backported #1 and #7 to D7.

#10: 1797296-10-t-file.patch queued for re-testing.

Issue tags:+Novice

Tagging as Novice.

#10: 1797296-10-t-file.patch queued for re-testing.

Status:Needs review» Reviewed & tested by the community

Hi,
patch in #10 seems good for me
Thanks

Status:Reviewed & tested by the community» Fixed

Thanks all! Committed to 7.x.

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