Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
16 / 16
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 Phexium\Domain\Id\TimestampId;
11
12test('from int and string', function (): void {
13    $fromInt = TimestampId::from(123);
14    $fromString = TimestampId::from('456');
15
16    expect($fromInt->getValue())->toBe(123)
17        ->and($fromString->getValue())->toBe(456)
18    ;
19});
20
21test('toString and equals', function (): void {
22    $id1 = TimestampId::from(100);
23    $id2 = TimestampId::from(100);
24    $id3 = TimestampId::from(200);
25
26    expect((string) $id1)->toBe('100')
27        ->and($id1->equals($id2))->toBeTrue()
28        ->and($id1->equals($id3))->toBeFalse()
29    ;
30});