Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
20 / 20
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3// ╔════════════════════════════════════════════════════════════╗
4// ║ MIT Licence (#Expat) - https://opensource.org/licenses/MIT ║
5// ║ Copyright 2026 Frederic Poeydomenge <dyno@phexium.com>     ║
6// ╚════════════════════════════════════════════════════════════╝
7
8declare(strict_types=1);
9
10pest()->group('unit');
11
12use AppDemo\User\Domain\UserGroup;
13
14describe('Values', function (): void {
15    it('returns correct human-readable labels', function (): void {
16        expect(UserGroup::Admin->label())->toBe('Administrator')
17            ->and(UserGroup::User->label())->toBe('User')
18        ;
19    });
20});
21
22describe('Behavior', function (): void {
23    it('identifies admin group correctly', function (): void {
24        expect(UserGroup::Admin->isAdmin())->toBeTrue()
25            ->and(UserGroup::User->isAdmin())->toBeFalse()
26        ;
27    });
28
29    it('identifies user group correctly', function (): void {
30        expect(UserGroup::User->isUser())->toBeTrue()
31            ->and(UserGroup::Admin->isUser())->toBeFalse()
32        ;
33    });
34});