Skip to content

Chore: Add alias e2e + integration test#236

Merged
Meldiron merged 1 commit into0.34.xfrom
chore-multi-alias-tests
Apr 17, 2026
Merged

Chore: Add alias e2e + integration test#236
Meldiron merged 1 commit into0.34.xfrom
chore-multi-alias-tests

Conversation

@Meldiron
Copy link
Copy Markdown
Contributor

No description provided.

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 17, 2026

Greptile Summary

This PR adds unit tests for route alias matching (RouterTest.php) and a corresponding e2e test (BaseTest.php + init.php) that verifies all alias paths return the expected response end-to-end. The assertions are consistent with the Router's wildcard-matching algorithm and the implementation looks correct.

Confidence Score: 5/5

Safe to merge — all changes are additive test code with no production logic modifications.

All findings are P2 style suggestions (minor coverage gaps in the new unit tests). No logic bugs, no security concerns, and the assertions correctly reflect the Router's actual wildcard-matching behavior.

No files require special attention.

Important Files Changed

Filename Overview
tests/RouterTest.php Adds three new unit test methods covering basic alias, multiple aliases, and a mixed wildcard+alias scenario; assertions align with the Router's wildcard-matching algorithm
tests/e2e/BaseTest.php Adds testAliases() to the shared trait, iterating over the primary path and three alias paths and asserting 200 + correct body for each
tests/e2e/init.php Adds /aliased route with three aliases; the chained ->alias() calls happen before ->inject()/->action() but this is safe since alias() stores a reference to the same Route object

Comments Outside Diff (1)

  1. tests/RouterTest.php, line 115-136 (link)

    P2 Incomplete wildcard base-path coverage

    testCanMatchMix() verifies that /console (the bare prefix of the /console/* alias) resolves to the route — good. However, /register (the bare prefix of /register/*) is never asserted. Given the symmetric Router wildcard-matching loop, both should behave identically; adding the assertion for /register would make the test fully symmetric and prevent a silent regression if the loop's logic changes.

Reviews (1): Last reviewed commit: "Add alias e2e + integration test" | Re-trigger Greptile

Comment thread tests/RouterTest.php
@Meldiron Meldiron merged commit ff58201 into 0.34.x Apr 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant