value)->toBe('run-123') ->and((string) $id)->toBe('run-123'); }); it('trims surrounding whitespace from the identifier', function () { $id = new InstallRunId(" run-123\t\n"); expect($id->value)->toBe('run-123'); }); it('rejects an empty identifier', function () { expect(fn () => new InstallRunId(''))->toThrow(InvalidArgumentException::class); }); it('rejects a whitespace-only identifier', function () { expect(fn () => new InstallRunId(" \t"))->toThrow(InvalidArgumentException::class); }); it('enforces the readonly identifier value', function () { $id = new InstallRunId('run-123'); expect(function () use ($id) { $id->value = 'mutated'; })->toThrow(Error::class); });