Problem/Motivation

The phpunit (next major) job fails on two unrelated test classes, and both come down to the theme the functional tests happen to run under.

DomainTokenTest. DomainTestBase sets $profile = 'standard' and declares no $defaultTheme, and core documents that property as defaulting to the install profile's default theme. So every functional test extending that base renders in whatever theme Standard installs, while several of them assert rendered markup. Core has moved that theme from Olivero to Claro in 12.0.0-alpha1, and then to Default Admin on current main. Default Admin overrides table.html.twig and builds each header cell's class out of the cell's label, so the block's table renders the Token header with a th__token class and the exact-markup assertion at DomainTokenTest.php:44 can no longer match.

DomainCSSTest. It installs Olivero and makes it the default theme, because its assertions required the domain CSS class to be the first class on the body element. Core 12 deprecates Olivero, so installing it raises a deprecation and the class exits non-zero even though every assertion in it passes.

Neither failure comes from an open merge request. Both reproduce on 4.x at 3f34ac57, on a phpunit (next major) job played against pipeline 962178. That lane sits behind a manual job which had never been played on 4.x, which is why neither had been seen before.

Steps to reproduce

On any recent 4.x pipeline, play the composer (next major) job and then the phpunit (next major) job.

Proposed resolution

Declare $defaultTheme = 'stark' on DomainTestBase. Stark overrides no templates, so the markup these tests read is core's own on every supported version. Ten other test classes in the suite already set exactly this, so it brings the shared base in line with the convention rather than introducing one.

In DomainCSSTest, assert the body classes through the DOM instead of as raw markup. That drops the requirement for the domain class to come first, which was the only reason a particular theme was needed, so the explicit Olivero install and the system.theme override can both go.

Remaining tasks

No backport to 3.x or 3.0.x. They carry the same base class and the same tests, but they declare ^10.2 || ^11, so their pipelines generate no next major lane and neither failure is reachable on the core versions they support: Olivero is not deprecated in 11.4, and the Standard profile there installs Olivero rather than Default Admin. Changing the theme that every functional test renders under would need its own verification run on each branch, in exchange for fixing nothing those branches can meet. This becomes a prerequisite if either branch is ever given core 12 support.

The suite still holds other assertions written against raw markup, in DomainTokenTest itself and in the domain_config tests. Pinning the theme protects them, and converting them is a separate cleanup.

AI-Generated: Yes (Claude Code was used to investigate the failures, to draft this issue summary and to write the changes on the merge request. I reviewed them before posting, and the pipeline is green on both the current and the next major core version.)

Issue fork domain-3624244

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

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review
mably’s picture

Title: Functional tests inherit the install profile's theme, so DomainTokenTest fails on Drupal 12 » Functional tests follow the install profile's theme and install the deprecated Olivero theme, so they fail on Drupal 12
Issue summary: View changes
mably’s picture

Issue summary: View changes

  • mably committed 1b783118 on 4.x
    fix: #3624244 Functional tests follow the install profile's theme and...
mably’s picture

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.