Can you point to some tests for depression? A quick Google only turned out some studies, nothing approved and usable in clinical settings (and one of the studies had a test that couldnt differentiate between depression and bipolar disorder).
Similarly, brain imaging for pain is at the research level, and may come with several other risks. I doubt there are such tests that could be used to conclusively prove that someone is or is not in pain.