diff options
| author | Sam Light <sam@lightscale.co.uk> | 2026-06-10 19:00:32 +0100 |
|---|---|---|
| committer | Sam Light <sam@lightscale.co.uk> | 2026-06-10 19:00:32 +0100 |
| commit | 4c6c1b00e69ea06367dba96b3b024af632b729b6 (patch) | |
| tree | 6f4d4700df5cd7d45a25082d0096ad70532438cd /tests/Unit/RouteMatchTest.php | |
| parent | b1b5696cf2fa0b2050d5b0387c4d819d2f41e4d4 (diff) | |
Refactor dispatch to use a seperate findRoute method
Diffstat (limited to 'tests/Unit/RouteMatchTest.php')
| -rw-r--r-- | tests/Unit/RouteMatchTest.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/Unit/RouteMatchTest.php b/tests/Unit/RouteMatchTest.php new file mode 100644 index 0000000..e3b8bce --- /dev/null +++ b/tests/Unit/RouteMatchTest.php @@ -0,0 +1,26 @@ +<?php + +declare(strict_types=1); + +use Lightscale\Router\Enums\HttpMethod; +use Lightscale\Router\PathSegment; +use Lightscale\Router\PathSegmentMatch; +use Lightscale\Router\Route; +use Lightscale\Router\RouteMatch; + +it('initializes with data', function () { + $v = new RouteMatch( + $segMatch = new PathSegmentMatch( + new PathSegment('test'), + [] + ), + $route = new Route( + HttpMethod::Get, + fn () => null, + ), + ); + + expect($v) + ->segmentMatch->toBe($segMatch) + ->route->toBe($route); +}); |
