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 | 6ad39e3ba64e518bcdba1fc32b6247375be39a8a (patch) | |
| tree | cc7ba7901043428b327d454580460e7b67c399b9 /tests/Unit/GroupDefinitionTest.php | |
| parent | 9e6a18235564df5046c40570a864bcbd5c8bcf62 (diff) | |
shared code in traits for common features for groups
Diffstat (limited to 'tests/Unit/GroupDefinitionTest.php')
| -rw-r--r-- | tests/Unit/GroupDefinitionTest.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/Unit/GroupDefinitionTest.php b/tests/Unit/GroupDefinitionTest.php index 3a064a1..59a8d3d 100644 --- a/tests/Unit/GroupDefinitionTest.php +++ b/tests/Unit/GroupDefinitionTest.php @@ -2,9 +2,22 @@ declare(strict_types=1); +use Lightscale\Router\Group; use Lightscale\Router\GroupDefinition; use Lightscale\Router\Router; +$make = fn () => new GroupDefinition(new Group(new Router(), null)); + it('initializes') - ->expect(fn () => new GroupDefinition(new Router())) + ->expect(fn () => $make()) ->toBeInstanceOf(GroupDefinition::class); + +it('creates group with prefix') + ->expect(fn () => $make()->prefix('/test')) + ->toBeInstanceOf(Group::class) + ->getPrefix()->toBe('/test'); + +it('creates group with name') + ->expect(fn () => $make()->name('name')) + ->toBeInstanceOf(Group::class) + ->getName()->toBe('name'); |
