Riyad as-Salihin #427 · The Book of Miscellany

Riyad as-SalihinBara' bin 'Azib
Riyad as-Salihin · Book 1 · The Book of Miscellany
Riyad as-Salihin · كتاب 1 · كتاب المقدمات
The Prophet (صلى الله عليه وسلم) said, "When a believer is questioned in the grave, he testifies that, 'there is no true god except Allah and Muhammad is the Messenger of Allah.' About him the Words of Allah, the Exalted, are: 'Allah will keep firm those who believe, with the firm statement (The Testimony of Faith) in this world and the Hereafter)". (14:27) [Al-Bukhari and Muslim] .
و
عن البراء بن عازب، رضي الله عنهما، عن النبي، صلى الله عليه وسلم، قال: “المسلم إذا سئل في القبر يشهد أن لا إله إلا الله، وأن محمداً رسول الله، فذلك قوله تعالى: {يثبت الله الذين آمنوا بالقول الثابت في الحياة الدنيا وفي الآخرة} ((إبراهيم:27)) ((متفق عليه)) .
Reference : Riyad as-Salihin 427In-book reference : Book 1, Hadith 427