value)->toBe('maija.meikalainen@example.fi'); }); it('rejects an invalid email address', function (string $email) { new EmailAddress($email); })->throws(InvalidEmailAddress::class)->with(['', 'maija', 'maija@', '@example.fi']); it('rejects an empty person name', function () { new PersonName(' '); })->throws(InvalidPersonName::class); it('knows which roles manage users and supervise interns', function () { expect(array_filter(Role::cases(), fn (Role $role) => $role->canManageUsers()))->toBe([Role::Admin]) ->and(array_values(array_filter(Role::cases(), fn (Role $role) => $role->canSupervise())))->toBe([Role::Management, Role::Employee]); });