Marcus Tullius Cicero said this quote

The shifts of fortune test the reliability of friends.