diff options
Diffstat (limited to 'tests/Unit')
| -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.'); |
