It's all in the title.

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

Test coverage for all validation constraints

Added Kernel tests for all four validation constraints in the domain_path module. The tests are organized with a shared base class to avoid duplication:

  • DomainPathKernelTestBase — shared setUp (entity schemas, config, 2 test domains, uid 1, path alias storage), generic filterViolations() helper, and createPathAlias() helper
  • DomainPathUniqueAliasTest — 6 tests for DomainPathUniquePathAliasConstraint (path_alias entity-level)
  • DomainPathFieldConstraintsTest — 7 tests for the three DomainPathItem field-level constraints

DomainPathUniqueAliasTest (path_alias uniqueness scoped by domain)

  • testSameAliasOnDifferentDomainsIsAllowed — /about on domain A + /about on domain B -> no violation
  • testSameAliasOnSameDomainConflicts — /about on domain A twice -> violation ("already in use in this domain")
  • testGlobalAliasDoesNotConflictWithDomainAlias — /about on domain A + global /about -> no violation
  • testDomainAliasDoesNotConflictWithGlobalAlias — global /about + /about on domain A -> no violation
  • testDuplicateGlobalAliasesConflict — global /about twice -> violation ("already in use")
  • testEditingExistingAliasDoesNotSelfConflict — re-validating an existing alias -> no violation

DomainPathFieldConstraintsTest (DomainPathItem field-level)

DomainPathSlash:

  • testSlashConstraintRejectsAliasWithoutSlash — alias without leading / -> violation
  • testSlashConstraintAllowsAliasWithSlash — alias with leading / -> no violation
  • testSlashConstraintAllowsEmptyAlias — empty alias -> no violation

DomainPathUnique:

  • testUniqueConstraintRejectsDuplicateAlias — alias matching existing domain path alias -> violation
  • testUniqueConstraintAllowsNewAlias — novel alias -> no violation

DomainPathUserAccess:

  • testUserAccessConstraintRejectsUnauthorizedUser — user without domain access -> violation
  • testUserAccessConstraintAllowsAuthorizedUser — admin with access -> no violation

The field constraints tests validate through full entity validation on node entities with the computed domain_path field, using domain_access module for realistic user access scenarios.

  • mably committed d87947ab on 2.x
    task: #3574501 Write tests for the DomainPathAlias validation...
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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.