its hard to tell if it was a test but if that's what they were doing you passed. I would let her know what her best friend was trying to do just in case it wasn't a test. It also could be that he likes her and wants you to stay away from her because he wants her.
Who knows hope this helps