Is there a test to find out if I have pid?

Yes. Usually a pelvic exam and a cervical culture provides the answer. Other sources of pelvic pain can be misinterpreted as pid, and frequently are in the emergency department. A positive culture is definitive; an exam alone always includes an element of opinion.
Pelvic exam. PID is a "clinical" diagnosis - meaning that we make the diagnosis based on symptoms and physical exam, not based on a lab test or imaging study. You have PID if you have pelvic pain, abnormal discharge, and if your doctor determines that you have "cervical motion tenderness" on exam (it hurts a LOT when your cervix is touched on exam). They may also test you for STDs.