Yes, it's possible to `/testfor` if someone is saying something in chat but you need plugins (`/testforchat`). Then you put in any text that you want the player to say and then you can mess around with it.