What if he doesn't agree with the law in question? I wouldn't consider it "integrity" to testify against an individual in a small-time drug case, for instance.
I agree with the other posters: if you do want to testify, ask for a subpoena.
This is bad advice. This is living life on hard mode. I wouldn't testify. You don't have anything to gain other than morality points, but you'll have everything real to lose.
Confucius once wrote that 'seeing the right thing and not doing it is cowardly'. This is still true today. But you are right that the life of a coward is easier.
Living a virtuous life is always 'hard mode'; if it were not, would we ever have bothered to identify virtue?
Sometimes doing the wrong thing (or at least "not the right thing") allows you to do a much bigger right thing in the end.
For example, Bill Gates. We all hated on Microsoft in the 90s. But Gates has become an amazingly generous humanitarian, which he couldn't have done if he donated all his money to charity in the beginning and didn't focus on ruthlessly building his company.