From 7d76684ad6cd0182545489d7ed54ae9823d94ffa Mon Sep 17 00:00:00 2001 From: Sam Light Date: Wed, 10 Jun 2026 19:00:33 +0100 Subject: Testing the creating routes on a group definition and code format --- tests/Unit/RouterTest.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'tests/Unit/RouterTest.php') diff --git a/tests/Unit/RouterTest.php b/tests/Unit/RouterTest.php index 9e9de88..5b11caf 100644 --- a/tests/Unit/RouterTest.php +++ b/tests/Unit/RouterTest.php @@ -234,14 +234,8 @@ it('makes a post route', function () { ->toBeInstanceOf(RouteMatch::class); }); -$methodGenerator = function (): Generator { - foreach (HttpMethod::cases() as $m) { - yield $m->value => $m; - } -}; - it('makes a :dataset route') - ->with($methodGenerator) + ->with('http-methods') ->expect(function (HttpMethod $m) { $router = new Router(); $router->{$m->value}($p = '/test1/test2', fn () => null); @@ -257,7 +251,7 @@ it('returns RouteDefinition when making route') ->toBeInstanceOf(RouteDefinition::class); it('returns RouteDefinition when making :dataset route') - ->with($methodGenerator) + ->with('http-methods') ->expect(fn (HttpMethod $m) => (new Router())->{$m->value}('/test', fn () => null)) ->toBeInstanceOf(RouteDefinition::class); -- cgit v1.2.3