Problem/Motivation

After #3616749: Drupal 12 compatibility: the RouteProvider constructor arguments and the shape of submitted domain field values the phpunit (next major) job still fails five tests. They are older than that issue and split into two unrelated core changes, neither of which is a bug in domain runtime code.

1. hook_module_implements_alter() was removed. The core commit for #3571069: Remove hook_module_implements_alter and support in HookCollectorPass ("Remove hook_module_implements_alter and support in HookCollectorPass") deleted the hook. The domain_config_hook_test support module uses it to switch its own procedural hook_user_login() back off, which is the whole point of the module: it reproduces a page cache policy that reads the config factory, plus a module that disables a hook. On the development branch the alter never runs, the hook fires, and the state key the test asserts to be empty is set. That is DomainConfigHookTest::testHookRuns and DomainConfigHookProblemTest::testHookRuns.

2. The standard profile no longer puts the front page on /node. The core commit for #3572350: Disable the default /node listing view, replace Olivero hardcoded welcome page from /node with welcome message ("Disable the default /node listing view...") changed core/profiles/standard/config/install/system.site.yml from front: /node to front: /user/login on 22 July, which is when these three tests started failing. DomainTestBase installs the standard profile.

DomainConfigUIOverrideTest::testOverrides reads the base system.site and asserts /node, so it now sees /user/login.

DomainPrefixFunctionalTest::testFormSubmissionOnPrefixedDomain saves the site information form as an administrator. The form revalidates the front page path and an authenticated user has no access to the login route, so the save is rejected with "Either the path '/user/login' is invalid or you do not have access to it" and the success message never appears.

DomainNavBlockTest::testDomainNav asserts the nav block links to user/login on each domain while that page is open. Because the configured front page is now that same path, the URL is written as the site root on the way out, the test browser lands on the root and the block builds its links from that request, so it emits the domain roots instead.

3. The lane stayed red with no failing test. The template sets SYMFONY_DEPRECATIONS_HELPER in its phpunit job, core 11.5 deprecated using that variable at all, and core run-tests.sh adds --fail-on-deprecation unconditionally, so that single deprecation failed every test class. Unsetting it exposes the forward compatibility warnings it had been muting, and core on the development branch additionally sets failOnPhpunitNotice, which catches a unit test that builds mock objects nothing asserts against.

Proposed resolution

For the first one, express the same scenario with an attribute that exists on both majors: RemoveHook and ReorderHook are present in Drupal 11.4 and on the development branch, so the support module can implement hook_user_login() as an OOP hook and remove it with #[RemoveHook], keeping what the test is really guarding without naming a removed API.

For the second one, stop assuming the profile front page. The tests that care about it should set it explicitly, which is what DomainTestBase already does for the content types the standard profile stopped creating in Drupal 11.4, and DomainNavBlockTest should exercise a path that is not the front page, since any URL for the front page path is rewritten to the site root.

The next-major job unsets the variable and points the deprecation filter at a project ignore file, with core own patterns appended to it. That file carries two patterns: the forward compatibility return types these classes do not declare yet, worded as core words the same pattern for its own modules, and one raised inside core language module. Six methods that already carry a description of their own gain a documented return value; the rest keep their {@inheritdoc} blocks untouched.

The route provider unit test builds its test doubles with createStub(), which is what the notice asks for and is correct on both majors.

Remaining tasks

Review the merge request. Worth noting separately: with the core default front page, saving the site information form as an administrator fails validation, because the default value points at a route the person saving cannot access. That is core behavior rather than domain, and it may deserve a core issue.

User interface changes

None.

API changes

None.

Data model changes

None.

AI-Generated: Yes (Claude Code was used to help draft this issue summary and to write the code and tests on the merge request. I reviewed and ran the work myself before posting it.)

Issue fork domain-3616783

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

Title: Fix the remaining Drupal 12 test failures: the standard profile front page and the removal of hook_module_implements_alter » Fix the remaining Drupal 12 test failures and stop deprecations failing the next-major lane
Issue summary: View changes

  • mably committed 367465fa on 4.x
    fix: #3616783 Fix the remaining Drupal 12 test failures: the standard...
mably’s picture

Status: Active » 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.