Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
11 / 11
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 Phexium\Plugin\Authorization\Adapter\StringSubject;
13
14describe('Creation', function (): void {
15    it('returns exact identifier as provided', function (): void {
16        $subject = StringSubject::fromString('custom-role');
17
18        expect($subject->getIdentifier())->toBe('custom-role');
19    });
20
21    it('accepts empty string as identifier', function (): void {
22        $subject = StringSubject::fromString('');
23
24        expect($subject->getIdentifier())->toBe('');
25    });
26});