The test is one that doesn't care about intent. If it can be found that, say, bespoke car makers (do they even exist?) based outside of California have a much harder time selling to California residents because of this law then it could be struck down. It would also be possible to use the lack of any small car makers as evidence against the law in question.