As per #500866: [META] remove t() from assert message, in particular:

  • Strip t() from plain-string assertion messages that are still using it.
    • <?php
      $this->assertWhatever($condition, t('My custom message here'));
      ?>
      

      Becomes:

      <?php
       $this->assertWhatever($condition, 'My custom message here');
      ?>
      
    • Assertion messages that have placeholders or variables will be converted to format_string(). This can be done separately if the patch is particularly large. (Mark issues that have already had messages with placeholders converted in the list below.)
    • Other parameters of assertions (beside the message parameter) are not changed.
    • Other uses of t() in automated tests are not changed.

Also, referring to a recent commit to Drupal 7, see 66bc8fb (Wed, 3 Jul 2013) as an example of what inspired this ticket.

It seems it would be recommended to remove calls to t() function in all asserts in reroute_email.test, for example in reroute_email.test, line 68:

$this->assertTrue($has_info, t('Found the correct "Originally to" line in the body'));

would become:

$this->assertTrue($has_info, 'Found the correct "Originally to" line in the body');

This is perhaps a rather minor change, but I thought it would allow us to keep the module a bit cleaner and aligned closer with Core standards.

Please let me know if you would have any questions, objections, comments, suggestions, recommendations or concerns on any aspects of this issue, I would be glad to provide more information or explain in more details.

Any questions, feedback, testing, changes, recommendations would be highly appreciated.
Thanks to all in advance.

Comments

dydave’s picture

Status: Active » Fixed

Quick follow-up on this issue:

All calls to t() function have either been removed or replaced by format_string() for all asserts in reroute_email.test.

I went ahead and committed the changes against the 7.x-1.x branch at a9d571b.

I allowed myself to mark this issue as fixed for now, but feel free to re-open it, or post a new ticket, at any time if you have any further objections with this issue or the changes made at a9d571b (we would surely be happy to hear your feedback).

Please let me know if you would have any further comments, feedback, questions, issues, objections, suggestions or concerns on the commit or this ticket in general, I would be glad to provide more information or explain in more details.

Thanks in advance to everyone for your testing, reviews, feedback and comments on this issue.
Cheers!

Status: Fixed » Closed (fixed)

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

dydave’s picture

Wanted to log a little bit more information/documentation in this ticket about this question: