Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
9 / 9
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\Domain\Id\TimestampId;
13use Tests\Phexium\Fake\Domain\Entity;
14
15describe('Equality', function (): void {
16    it('considers entities with same ID as equal', function (): void {
17        $id = TimestampId::from(12345);
18        $entity1 = new Entity($id, 'Name 1');
19        $entity2 = new Entity($id, 'Name 2');
20
21        expect($entity1->equals($entity2))->toBeTrue();
22    });
23});