value) ->toBe('0115590') ->and((string) $employeeId)->toBe('0115590'); }); it('instantiates successfully with a valid 8-digit matricule', function (): void { // GIVEN $validMatricule = '01155902'; // WHEN $employeeId = new ArcadiaEmployeeId($validMatricule); // THEN expect($employeeId->value) ->toBe('01155902') ->and((string) $employeeId)->toBe('01155902'); }); it('supports equality check with another ArcadiaEmployeeId instance', function (): void { // GIVEN $firstId = new ArcadiaEmployeeId('01155902'); $sameId = new ArcadiaEmployeeId('01155902'); $differentId = new ArcadiaEmployeeId('01155901'); // WHEN & THEN expect($firstId->equals($sameId)) ->toBeTrue() ->and($firstId->equals($differentId)) ->toBeFalse(); }); it('can be converted to a string representation', function (): void { // GIVEN $employeeId = new ArcadiaEmployeeId('01155902'); // WHEN $stringRepresentation = (string) $employeeId; // THEN expect($stringRepresentation)->toBe('01155902'); }); }); describe('ArcadiaEmployeeId Value Object Domain Rules', function (): void { it('throws a DomainException when given an invalid matricule pattern', function (): void { // GIVEN $invalidMatricule = '12345'; // WHEN & THEN expect(fn () => new ArcadiaEmployeeId($invalidMatricule)) ->toThrow(\DomainException::class); }); });