Closed (fixed)
Project:
Subentity
Version:
3.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
12 Jun 2026 at 14:55 UTC
Updated:
3 Jul 2026 at 14:30 UTC
Jump to comment: Most recent
The subentity module lacks automated test coverage for several critical classes. ReferencedEntityAccessControlHandler has partial kernel test coverage but several paths are untested. EntityParentHandler::getStorageByEntityType() and the Drush generator (SubEntityGenerator) have no tests at all.
Kernel tests covering EntityParentHandler::getStorageByEntityType():
Unit tests covering the Drush generator:
generate() exist on diskrouting.yml.twig uses the module-specific administer subentities permission and not the generic administer site configurationAdditional cases for the existing test class:
checkAccess() when no parent references the subentity → should return neutral()checkAccess() when the parent exists but denies the operation → should return neutral()checkCreateAccess() when a referencing field exists and the parent allows creation → should return allowed()tests/src/Kernel/EntityParentHandlerTest.phptests/src/Unit/SubEntityGeneratorTest.phptests/src/Kernel/ReferencedEntityAccessControlHandlerTest.phpphpunit --group subentityStart 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 #2
macsim commentedComment #3
macsim commentedComment #6
macsim commented