Update docs to stop recommending FormattableMarkup

Created on 30 November 2023, about 1 year ago
Updated 5 September 2024, 3 months ago

Problem/Motivation

Core is trying to stop using FormattableMarkup (see many other issues in this one's family tree).

AssertContentTrait is full of docblocks that recommend using FormattableMarkup.

Steps to reproduce

View core/tests/Drupal/KernelTests/AssertContentTrait.php

Proposed resolution

Remove usages of FormattableMarkup.

Before

   * @param string $message
   *   (optional) A message to display with the assertion. Do not translate
   *   messages: use \Drupal\Component\Render\FormattableMarkup to embed
   *   variables in the message text, not t(). If left blank, a default message
   *   will be displayed.

After

   *   (optional) A message to display with the assertion. Do not translate
   *   messages with t(). Use double quotes and embed variables directly in
   *   message text, or use sprintf() if necessary. Avoid the use of
   *   \Drupal\Component\Render\FormattableMarkup unless you cast the object to
   *   a string. If left blank, a default message will be displayed.

Remaining tasks

  1. Decide on the exact text.
  2. Search/replace in AssertContentTrait to update everything.
  3. Open an MR and push the commit that makes the changes.
  4. Review / refinement.
  5. RTBC.
  6. Commit.

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Fixed

Version

10.3 ✨

Component
PHPUnit  →

Last updated about 1 hour ago

Created by

🇺🇸United States dww

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024