Remove possible duplicate test XssUnitTest::testBadProtocolStripping

Created on 27 February 2023, over 2 years ago
Updated 25 August 2025, 4 days ago

Problem/Motivation

While working on 📌 Fix class comment doc blocks in tests for 'Drupal.Commenting.DocComment.ShortSingleLine' Fixed I noticed that \Drupal\KernelTests\Core\Common\XssUnitTest appears to be duplicating tests that are elsewhere.

testBadProtocolStripping(). This is testing URL helper methods which are tested in \Drupal\Tests\Component\Utility\UrlHelperTest and with what appears to be more robust test data.

testT() - Surely t() has better testing elsewhere?

\Drupal\KernelTests\Core\Common\XssUnitTest was added in #1598564: Convert common.test to PSR-0

Steps to reproduce

Proposed resolution

Remove testBadProtocolStripping and possibly testT()

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component
Base 

Last updated 36 minutes ago

Created by

🇳🇿New Zealand quietone

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • Issue created by @quietone
  • First commit to issue fork.
  • Pipeline finished with Failed
    4 days ago
    Total: 165s
    #580754
  • Pipeline finished with Failed
    4 days ago
    Total: 211s
    #580773
  • Pipeline finished with Failed
    4 days ago
    Total: 500s
    #580776
  • 🇺🇸United States smustgrave

    So now we have a file that doesn't have any tests. Was testT() verified to be duplicate

  • 🇮🇳India ajinkya45 Pune

    testT() in XssUnitTest was testing basic t() passthrough, placeholder substitution (@value), and themed placeholder (%value) escaping.
    These are fully covered in the dedicated translation kernel tests:
    - core/tests/Drupal/KernelTests/Core/StringTranslation/TranslationStringTest.php
    - Other translation-related kernel tests in core.
    No functional coverage is lost by removing testT() from XssUnitTest.

    So in that case, should the file be entirely deleted?

Production build 0.71.5 2024