Bara bin Azib reported,

The Prophet ﷺ said, "When the believer is seated in his grave, he is brought forth and bears witness that there is no god but Allah and that Muhammad is the Messenger of Allah ﷺ. That is the meaning of His saying, 'Allah keeps firm those who believe with the firm word' [Ibrahim 14:27]."

Azami 3871

Sahih

عن البراء بن عازب

عن النبي ﷺ قال: إذا أقعد المؤمن في قبره، أتي ثم شهد أن لا إله إلا الله وأن محمدا رسول الله ﷺ فذلك قوله: {يثبت الله الذين آمنوا بالقول الثابت} [إبراهيم: ٢٧].

الأعظمي 3871صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Conditions of the deceased in the grave
Section
Allah keeps firm those who believe with the firm word in the grave, and Allah leaves astray the wrongdoers in the grave
Numbering
Jami al-Kamil 3871 (2nd edition)
Azami 3871