It really doesn't need to be a class action. It only takes one person who is subject to enforcement of the illegal law. Often, more than one plaintiff is named, each with slightly different qualifications in case it's found that one or more do not have standing.