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 | 25780fef281782ce7e88c27cb23cb3d9e9d6bd03 (patch) | |
| tree | 65b940f7e52f133356b6dbfc478732497749399b | |
| parent | 11cb664b7a1956ec18227088be08b098a1a14865 (diff) | |
test the getFullName method on Group
| -rw-r--r-- | tests/Unit/GroupTest.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/Unit/GroupTest.php b/tests/Unit/GroupTest.php index a2f06b2..5bb82bc 100644 --- a/tests/Unit/GroupTest.php +++ b/tests/Unit/GroupTest.php @@ -109,3 +109,33 @@ it('gets the path with three ancestors, one without prefix') )->prefix('hello/world') )->prefix('/t1/t2')->getFullPrefix()) ->toBe('/test/hello/world/t1/t2'); + +it('gets the name with no prefix or parents') + ->expect(fn () => $make()->getFullName()) + ->toBeNull(); + +it('gets the name without parents') + ->expect(fn () => $make()->name('test-test')->getFullName()) + ->toBe('test-test'); + +it('gets the name with parent') + ->expect(fn () => $make( + $make()->name('hello-world.') + )->name('test')->getFullName()) + ->toBe('hello-world.test'); + +it('gets the name with two ancestors') + ->expect(fn () => $make( + $make( + $make()->name('test.') + )->name('test1') + )->name('hello')->getFullName()) + ->toBe('test.test1hello'); + +it('gets the name with three ancestors, one without name') + ->expect(fn () => $make( + $make( + $make($make()->name('test1.')) + )->name('test2.') + )->name('test3.')->getFullName()) + ->toBe('test1.test2.test3.'); |
