Automated tests fail on Drupal 11.4 because core's Standard install profile no longer ships the page and article content types. The Domain Path functional and FunctionalJavascript tests relied on those content types being present, so they now error or fail. This was surfaced by the merge request pipeline in #3611433.
This issue fixes the test suite for Drupal 11.4 (while keeping Drupal 11.3 support) and clears two related PHPStan warnings.
Symptoms on Drupal 11.4
- LogicException: Missing bundle entity, entity type node_type, entity id page (content translation setup).
- Invalid permission "create page content" when creating test users.
- HTTP 500 when creating and viewing nodes of the missing page type.
- HTTP 404 on node/add/page and node/add/article.
- Domain Access form field field_domain_access not found.
PHPStan
The functional and kernel test base classes cached the path alias entity storage in a property, triggering the drupal.entityStoragePropertyAssignment rule twice.
Fix
- Create a dedicated test_page content type in the functional test base instead of relying on the install profile, and re-confirm the Domain Access fields on it so they render on the node form.
- Switch all test references from the profile-provided page and article types to test_page, adding a second pattern-less test_article type where a test needs two bundles.
- Replace the cached path alias storage property with a pathAliasStorage() accessor.
All changes are confined to the test suite. No test methods or assertions were removed (93 test methods and 263 assertions before and after). Verified on Drupal 11.4.1: the full Kernel suite and the main module Functional suite pass.
Issue fork domain_path-3611459
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
Comment #3
mably commentedOpened MR !121 against 3.x.
Root cause: on Drupal 11.4 core's Standard install profile no longer ships the page and article content types, which the functional and FunctionalJavascript tests relied on. The tests now create a dedicated test_page content type in the base classes and re-confirm the Domain Access fields on it, and all references were switched from page/article to test_page (with a second pattern-less test_article type where a test needs two bundles).
Also fixed the two PHPStan drupal.entityStoragePropertyAssignment warnings by replacing the cached path alias storage property with a pathAliasStorage() accessor, and enabled phpunit concurrency in GitLab CI.
All changes are confined to the test suite: no test methods or assertions were removed (93 test methods and 263 assertions before and after). CI is green on both the current and previous major, sequentially and with _PHPUNIT_CONCURRENT.
Comment #5
mably commented