Problem/Motivation

Tests the formatter output with different formatter settings.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

igor mashevskyi created an issue. See original summary.

akshay kashyap’s picture

I tested this MR locally on a clean Drupal installation and went through all of the scenarios covered by the new kernel test.

I also verified the formatter manually with different settings, including:

  • * Default formatter output
  • * Trimming with and without ellipsis
  • * HTML filtering with allowed tags
  • * Auto paragraph handling
  • * Using the summary instead of the full text
  • * Trimming the summary

In each case, the rendered output matched the expected result, and the new kernel test passed successfully.

I also ran the module's test suite after applying the MR and didn't encounter any regressions or unexpected failures.

Overall, this is a nice improvement. The data provider makes the test easy to read and extend, and it provides good coverage for the formatter's core functionality. This should help catch regressions if changes are made to the formatter in the future.

I only have a couple of minor suggestions:

  • * It would be good to add return type hints (: void for the test method and : array for the data provider) to keep the test consistent with current Drupal coding standards.
  • * If token replacement is supported by the formatter, it may also be worth adding a dedicated test case for that setting in a follow-up issue.

Other than those minor suggestions, the implementation looks good to me, and all the scenarios I tested locally are working as expected.

akshay kashyap’s picture

Status: Active » Needs review

igor mashevskyi’s picture

Assigned: igor mashevskyi » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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