Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
10 / 10
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\Loan\Domain\Exception\BookNotAvailableException;
13use Phexium\Domain\Id\TimestampId;
14
15describe('Creation', function (): void {
16    it('creates an exception with book ID in message', function (): void {
17        expect(fn () => throw BookNotAvailableException::forBook(
18            TimestampId::from(123)
19        ))
20            ->toThrow(BookNotAvailableException::class, 'ID 123')
21        ;
22    });
23});