From 8c0efd0d9317ad92bd55cd6afcd41bdbab827bf8 Mon Sep 17 00:00:00 2001 From: Sam Light Date: Wed, 10 Jun 2026 19:00:32 +0100 Subject: Make basic routing work --- tests/Unit/RouteTest.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'tests/Unit/RouteTest.php') 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); +}); -- cgit v1.2.3