Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
8 / 8 |
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 | |
| 8 | declare(strict_types=1); |
| 9 | |
| 10 | use Phexium\Plugin\Authorization\Adapter\StringSubject; |
| 11 | |
| 12 | test('Returns exact identifier as provided', function (): void { |
| 13 | $subject = StringSubject::fromString('custom-role'); |
| 14 | |
| 15 | expect($subject->getIdentifier())->toBe('custom-role'); |
| 16 | }); |
| 17 | |
| 18 | test('Accepts empty string as identifier', function (): void { |
| 19 | $subject = StringSubject::fromString(''); |
| 20 | |
| 21 | expect($subject->getIdentifier())->toBe(''); |
| 22 | }); |