We were with the Messenger of Allah ﷺ when he said, "Count for me how many people pronounce Islam."We said, "Messenger of Allah, do you fear for us when we number between six hundred and seven hundred?"He replied, "You do not know, perhaps you will be tested."He said, "Then we were tested, until a man among us would not pray except in secret."In another wording, "We counted for him one thousand five hundred men, and we said, 'Should we fear when we are one thousand five hundred?'"
كنا مع رسول الله ﷺ فقال: أحصوا لي كم يلفظ الإسلام قال: فقلنا: يا رسول الله، أتخاف علينا ونحن ما بين الستمائة إلى السبعمائة؟ قال: إنكم لا تدرون لعلكم أن تبتلوا قال: فابتلينا حتى جعل الرجل منا لا يصلي إلا سرا. وفي لفظ: فكتبنا له ألفا وخمسمائة رجل، فقلنا: نخاف ونحن ألف وخمسمائة.
Muslim narrated it in the Book of Faith (149:235) via Abu Muawiya, from Amash, from Shaqiq, from Huzaifa, who related it.Bukhari mentioned it without a connected chain in the Book of Jihad and Expeditions (3060), from Abu Muawiya, with the same chain.The other wording is Bukhari's, in the same place, with a connected chain via Sufyan (that is, Thawri), from Amash, with the same chain.