Yeah I'd agree with Jeremy's answer - that is one test of prayer working, if it makes the person praying feel better. I don't think it is the only test but it is one way of testing. I think it's impossible to come up with a single test for prayer working as it depends on what the prayer is and what the person praying hopes to gain from it.
For example - even though I am talking about Muslim prayer here, I imagine it is similar in any faith - sometimes asking for help when you pray, even if you don't get what you asked for, helps you put your situation in a different perspective. For example, I feel like the reminder of God that I get through prayer strengthens my sense of resolve and I perceive my problems as something I can accept with more equanimity and learn from. The actual process of praying - the movements, the verses being recited, my mind taking some time out from my deadlines and being free to ponder ideas about "the meaning of life", whether I have identified with any particular purpose to my life, my relationships, things I have to be thankful for etc - can all have a calming influence and alter my mood.