Remove all usage of FormattableMarkup in tests apart from explicit tests of that API

Created on 11 August 2015, over 9 years ago
Updated 25 August 2024, 4 months ago

Follow-up to #2527360: Review all usages of Xss::filter(), Xss::filterAdmin(), and Html::escape()

We're using SafeMarkup::format in tests. We should not as this pollutes the safe string list and is irrelevant.

Where we are using it in $this->assertRaw() we should just convert it to a string. Where we are using it in an assertion message we should just convert it to a string with the variables inserted like "This is a $lol test".

📌 Task
Status

Closed: duplicate

Version

11.0 🔥

Component
PHPUnit 

Last updated 1 day ago

Created by

🇬🇧United Kingdom alexpott 🇪🇺🌍

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand quietone

    Closing as a duplicate of 📌 [meta] Remove usage of t() in tests not testing translation Active and moving credit.

  • 🇳🇿New Zealand quietone

    I think I should not have closed this. I was probably focused on t() at the time but today I see uses of FormattableMarkup in tests where it could be removed. And I guess I didn't read #74.

    Sorry folks.

  • Status changed to Active 22 days ago
  • 🇷🇺Russia zniki.ru

    Thanks everyone for your effort.

    It looks like title and summary are different, as already mentioned at #51, and it's extremely difficult to understand what is happening here/
    As I understand original issue was "Remove all usage of SafeMarkup::format() and format_string() in tests apart from explicit tests of those methods".

    I checked patch #78, at the top we remove t() function.

    My suggestion:
    revert issue title to original value and close this issue, and create new one with focus to remove FormattableMarkup.

    In order to provide code contribution is better to use child issue #3227598: Remove uses of FormattableMarkup in kernel test assertions .

Production build 0.71.5 2024