The companies that distribute to stores full-size bottles of perfume with the word "Tester" printed on it intend that they be used by individual customers, one "spray" each. They do not intend that the store owner, or anybody else, take the whole bottle and sell it. Anyone who does so, then, is a thief.
However, it is possible that the distributors find themselves with an excess of such bottles and, seeing as they can't sell them for the full price due to the word "Tester," sell them off at a reduction.
You need to make inquiries as to whether there is such a legal market.
If, however, all, or even most of such "Tester" bottles are not intended to be sold as a single unit, you may not purchase them from anyone. This is for two reasons: Firstly, depending on the circumstances, you may actually be considered a party to the actual thieving. And secondly, by buying from a thief you are aiding and abetting him, and as a result you are encouraging him to steal again. If he could not sell the goods, he wouldn't steal them. In the words of the Gemora, "It's not the mouse that steals, it's the [mouse]hole."