Summary
Add test coverage to confirm that middleware route strings are resolved relative to the current module’s Middlewares namespace, including nested middleware paths.
This is a verification ticket to lock in current middleware resolution behavior.
Why
Middleware resolution in Quantum already appears to support nested module-relative middleware paths.
Current middleware resolution constructs middleware classes as:
{ModuleBaseNamespace}\{CurrentModule}\Middlewares\{MiddlewareName}
That means route middleware strings such as:
should already resolve correctly within the current module.
Since this behavior is important for future routing organization and may become especially relevant alongside controller namespace improvements and API versioning work, it should be covered by explicit tests.
Goal
Add tests that verify middleware resolution for both flat and nested module-relative middleware paths.
Proposed Direction
Test middleware route definitions such as:
->middlewares(['Auth'])
->middlewares(['V1\Auth'])
->middlewares(['Admin\Audit'])
and verify that Quantum resolves them to the expected middleware classes inside the current module.
Acceptance Criteria
- tests verify flat middleware resolution inside the current module
- tests verify nested middleware resolution such as
V1\Auth
- tests verify deeper nested middleware resolution such as
Admin\Audit
- tests confirm middleware resolution remains module-relative
- tests help protect current behavior while controller resolution and API versioning work evolve
Notes
Relevant code:
src/Middleware/MiddlewareManager.php
src/Router/Route.php
src/Router/RouteBuilder.php
- module template middlewares under
src/Module/Templates/*/src/Middlewares
This ticket is intended as verification coverage, not as a middleware architecture change.
Summary
Add test coverage to confirm that middleware route strings are resolved relative to the current module’s
Middlewaresnamespace, including nested middleware paths.This is a verification ticket to lock in current middleware resolution behavior.
Why
Middleware resolution in Quantum already appears to support nested module-relative middleware paths.
Current middleware resolution constructs middleware classes as:
{ModuleBaseNamespace}\{CurrentModule}\Middlewares\{MiddlewareName}That means route middleware strings such as:
AuthV1\AuthAdmin\Auditshould already resolve correctly within the current module.
Since this behavior is important for future routing organization and may become especially relevant alongside controller namespace improvements and API versioning work, it should be covered by explicit tests.
Goal
Add tests that verify middleware resolution for both flat and nested module-relative middleware paths.
Proposed Direction
Test middleware route definitions such as:
->middlewares(['Auth'])->middlewares(['V1\Auth'])->middlewares(['Admin\Audit'])and verify that Quantum resolves them to the expected middleware classes inside the current module.
Acceptance Criteria
V1\AuthAdmin\AuditNotes
Relevant code:
src/Middleware/MiddlewareManager.phpsrc/Router/Route.phpsrc/Router/RouteBuilder.phpsrc/Module/Templates/*/src/MiddlewaresThis ticket is intended as verification coverage, not as a middleware architecture change.