First, until and unless you are subpoenaed, you do not need to testify: an officer can "ask" you to testify, but it takes a subpoena to force you to testify. If you are subpoenaed, contact the prosecutor's office and explain that they have the wrong man or woman--you don't know this person, never bought drugs from him or anyone, etc. They may realize their mistake (e.g. they might have you confused with someone else with a similar name, or who used to live at your address) and cancel the subpoena. If they won't and insist on having you testify, all you can do is testify honestly on the witness stand.