Improve test coverage for theme output

Created on 17 April 2013, about 12 years ago
Updated 2 July 2025, 11 days ago

Problem/Motivation

The test coverage for theme output across core is patchy, and in some places not well implemented.

Tests that compare one string of HTML output to another are fragile, and failures are not necessarily representitive of a failure to the user (perhaps because an elements attributes are in a different order.

Proposed resolution

Improve coverage of themed output
Test core themes separately
Use superior analysis tools such as CSS Selectors or XPath/SimpleXml to perform assertions with rendered output.
More - TBD

Remaining tasks

Everything!

User interface changes

N/A

API changes

TBD

Related Issues

#1971860: Document that Twig debug mode breaks tests β†’
#1959660: Replace xpath() with WebTestBase::cssSelect() by leveraging Symfony CssSelector β†’

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

theme system

Created by

πŸ‡¬πŸ‡§United Kingdom shanethehat

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

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.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

Production build 0.71.5 2024