diff options
| author | Sam Light <sam@lightscale.co.uk> | 2026-06-10 19:00:33 +0100 |
|---|---|---|
| committer | Sam Light <sam@lightscale.co.uk> | 2026-06-10 19:00:33 +0100 |
| commit | 7d76684ad6cd0182545489d7ed54ae9823d94ffa (patch) | |
| tree | beb2f79d2ff695a1dd467d95276947f655adaffb /tests/Unit/RouterTest.php | |
| parent | 968662ee16a1efc7cb7c176a42af91f36eecc9ca (diff) | |
Testing the creating routes on a group definition and code format
Diffstat (limited to 'tests/Unit/RouterTest.php')
| -rw-r--r-- | tests/Unit/RouterTest.php | 10 |
1 files changed, 2 insertions, 8 deletions
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); |
