Add routing tests for nested module-relative middleware resolution

オープン 初心者向け
#547 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
php
領域
backend, testing

調査の方向性

まず src/Middleware/MiddlewareManager.php、src/Router/Route.php、src/Router/RouteBuilder.php を読み、モジュール相対の middleware 解決を追跡します。次に、src/Module/Templates/*/src/Middlewares 配下にあるモジュールテンプレートの middleware パスを調べ、その後 Auth、V1\Auth、Admin\Audit の routing テストを追加します。テストによって、フラットな middleware 名、ネストされた middleware 名、さらに深くネストされた middleware 名が現在のモジュール内で解決されることを確認できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

routing testing

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:

  • Auth
  • V1\Auth
  • Admin\Audit

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.

主要言語
PHP
スター
36
フォーク
22
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

quantum-php/framework のほかの issue

quantum-php/framework の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。