summaryrefslogtreecommitdiff
path: root/tests/Unit/RouteTest.php
diff options
context:
space:
mode:
authorSam Light <sam@lightscale.co.uk>2026-06-10 19:00:32 +0100
committerSam Light <sam@lightscale.co.uk>2026-06-10 19:00:32 +0100
commit8c0efd0d9317ad92bd55cd6afcd41bdbab827bf8 (patch)
treec654456753e90ab38b7bcb89ece3381ad7a40f4a /tests/Unit/RouteTest.php
parent5fe7c87967ff29c4a8f03a9186918d8359f4887e (diff)
Make basic routing work
Diffstat (limited to 'tests/Unit/RouteTest.php')
-rw-r--r--tests/Unit/RouteTest.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/Unit/RouteTest.php b/tests/Unit/RouteTest.php
index 104401b..50513a1 100644
--- a/tests/Unit/RouteTest.php
+++ b/tests/Unit/RouteTest.php
@@ -47,12 +47,10 @@ it('gets method')
))->getMethod())
->toBe(HttpMethod::Get);
-it('can call handler')
- ->expect(fn () => (new Route(
+it('can get handler', function() {
+ $r = new Route(
HttpMethod::Get,
- fn (RequestInterface $req) => $req->getUri()->getPath()
- ))(
- (new Psr17Factory())->createRequest(HttpMethod::Get->value, '/testing')
- )
- )
- ->toBe('/testing');
+ $h = fn (RequestInterface $req) => $req->getUri()->getPath()
+ );
+ expect($r->getHandler())->toBe($h);
+});