The rule in school isn't "probable cause", it's "reasonable suspicion" (New Jersey v. TLO, 1984--good year for such a ruling, neh?). That means if it seems reasonable that you could have done it--not probable that you did do it-- they can search you. That means anything from "his friends said he did it" to "he looks sketchy" or "he smells like weed" will fly if you're in a school. By that argument, such a search would probably hold up in court.

That said, if you're being searched against your will, make sure you make that clear. Just say, "Officer, I do not consent to this search. I will not cause any trouble, but this search is against my will."

Anyway, your friends are the truest forms of assholes. As they say, "don't do the crime if you can't do the time." Your friends would do well to heed that. At least they got busted and you didn't; it looks like fate was on your side this time.

However, you shouldn't carry drugs with you in school. Given the lowered standards for searches, it's the worst possible place to do anything illegal.