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 | 8c0efd0d9317ad92bd55cd6afcd41bdbab827bf8 (patch) | |
| tree | c654456753e90ab38b7bcb89ece3381ad7a40f4a /tests/Unit/RouteTest.php | |
| parent | 5fe7c87967ff29c4a8f03a9186918d8359f4887e (diff) | |
Make basic routing work
Diffstat (limited to 'tests/Unit/RouteTest.php')
| -rw-r--r-- | tests/Unit/RouteTest.php | 14 |
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); +}); |
