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.php → tests/lib/Application/Admin/ResourcePermissionServiceTest.php
lib/Application/Authentication/LdapAuthentication.php → tests/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
Summary
Test files do not consistently mirror the directory structure of the source files they test. For example, tests for
lib/Application/Admin/live intests/Application/Admin/(dropping thelib/prefix), while tests forPresenters/Admin/live intests/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.php→tests/lib/Application/Admin/ResourcePermissionServiceTest.phplib/Application/Authentication/LdapAuthentication.php→tests/lib/Application/Authentication/LdapAuthenticationTest.phpNotes
phpunit.xml.disttest suite directories will need to be updated to include the new paths (e.g. add./tests/lib/Applicationto theapplicationsuite)