The Messenger of Allah ﷺ said one day in his sermon, "My Lord has commanded me to teach you what you do not know from what He has taught me this day."He also said, "I sent you only to test you and to test others through you."
أن رسول الله ﷺ قال ذات يوم في خطبته: ألا إن ربي أمرني أن أعلمكم ما جهلتم مما علمني يومي هذا… وقال: إنما بعثتك لأبتليك وأبتلي بك…
Muslim narrated it in the Book of Paradise, Its Description and Its People (2865) through several routes from Muaz bin Hisham, who said, my father narrated to me, from Qatada, from Mutarrif bin Abdullah bin Shikhir, from Iyad bin Himar Majashi, who mentioned it in a long hadith.