Humans have thought and morality and basic knowledge only through education. We're not born with the knowledge of the world or even basic fact. I know that animals aren't capable of morality or maybe grasping scientific facts but lack of knowledge doesn't mean you should just kill something.
I think this would also raise issues with pest control. Pest insects are animals, should they have legal protection? And animals such as mice and rats definitely feel pain, but wild ones can spread disease and destroy crops. Would they also have legal protection, on the basis of them being reasonably intelligent and sentient?
On another note, personally I don't like animal testing, but I think that it is probably necessary at this time. However, with the development of projects such as the Virtual Physiological Human, it may be possible to reduce usage of animals in research and testing.