Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
15 / 15
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
10use AppDemo\User\Domain\UserGroup;
11
12test('Label returns correct human-readable strings', function (): void {
13    expect(UserGroup::Admin->label())->toBe('Administrator')
14        ->and(UserGroup::User->label())->toBe('User')
15    ;
16});
17
18test('isAdmin() returns true only for Admin', function (): void {
19    expect(UserGroup::Admin->isAdmin())->toBeTrue()
20        ->and(UserGroup::User->isAdmin())->toBeFalse()
21    ;
22});
23
24test('isUser() returns true only for User', function (): void {
25    expect(UserGroup::User->isUser())->toBeTrue()
26        ->and(UserGroup::Admin->isUser())->toBeFalse()
27    ;
28});