How to test a pill for presence of opioids?

I wanted to know if a pill had presence of opioids, (I’ve done fentanyl test, I mean any opioid in general). Can I use a urine test on a drug sample? Is there any specific drug purity tests? I’m in UK