Mishkat al-Masabih 125
عَن الْبَرَاءِ بْنِ عَازِبٍ أَنَّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ: الْمُسْلِمُ إِذَا سُئِلَ فِي الْقَبْرِ يَشْهَدُ أَنْ لَا إِلَهَ إِلَّا اللَّهُ وَأَنَّ مُحَمَّدًا رَسُولُ اللَّهِ فَذَلِكَ قَوْلُهُ (يُثَبِّتُ اللَّهُ الَّذِينَ آمَنُوا بِالْقَوْلِ الثَّابِتِ فِي الْحَيَاةِ الدُّنْيَا وَفِي الْآخِرَة) وَفِي رِوَايَةٍ عَنِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ: (يُثَبِّتُ اللَّهُ الَّذِينَ آمَنُوا بِالْقَوْلِ الثَّابِت) نَزَلَتْ فِي عَذَابِ الْقَبْرِ يُقَالُ لَهُ: مَنْ رَبك؟ فَيَقُول: رَبِّي الله ونبيي مُحَمَّد
From al-Baraʾ ibn ʿAzib that the Messenger of Allah ﷺ said: "The Muslim, when he is questioned in the grave, testifies that there is no god but Allah and that Muhammad is the Messenger of Allah. That is His saying: 'Allah keeps firm those who believe with the firm word in the life of this world and in the Hereafter.'" And in a narration from the Prophet ﷺ, he said: "'Allah keeps firm those who believe with the firm word' was revealed about the punishment of the grave. It is said to him: 'Who is your Lord?' and he says: 'My Lord is Allah, and my Prophet is Muhammad.'"