Skip to content

refactor(tests): restructure test directories to mirror source paths #1176

@JohnVillalovos

Description

@JohnVillalovos

Summary

Test files do not consistently mirror the directory structure of the source files they test. For example, tests for lib/Application/Admin/ live in tests/Application/Admin/ (dropping the lib/ prefix), while tests for Presenters/Admin/ live in tests/Presenters/Admin/ (exact mirror).

This inconsistency makes it harder to locate the test file for a given source file.

Proposed change

Restructure the tests/ directory so that test file paths exactly mirror their source file paths. For example:

  • lib/Application/Admin/ResourcePermissionService.phptests/lib/Application/Admin/ResourcePermissionServiceTest.php
  • lib/Application/Authentication/LdapAuthentication.phptests/lib/Application/Authentication/LdapAuthenticationTest.php

Notes

  • phpunit.xml.dist test suite directories will need to be updated to include the new paths (e.g. add ./tests/lib/Application to the application suite)
  • This should be done as a single batch move to avoid partial inconsistency
  • Consider updating CLAUDE.md test naming conventions to reflect the new structure

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions