Mishkat al-Masabih 125
Al-Bara’ b. ‘Azib reported the Prophet as saying, “When a Muslim is questioned in the grave he testifies that there is no god but God and that Muhammad is God’s messenger.” That is verified by God’s words, “God establishes those who believe with the word that stands firm in this world and the next.” 1 In a version the Prophet said:
“God establishes those who believe with the word which stands firm” was revealed concerning the punishment in the grave. One will be asked who his Lord is and will reply that his Lord is God and his prophet is Muhammad. 

(Bukhari and Muslim.) 1 Quran, xiv, 27.
عَن الْبَرَاءِ بْنِ عَازِبٍ أَنَّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ: " الْمُسْلِمُ إِذَا سُئِلَ فِي الْقَبْرِ يَشْهَدُ أَنْ لَا إِلَهَ إِلَّا اللَّهُ وَأَنَّ مُحَمَّدًا رَسُولُ اللَّهِ فَذَلِكَ قَوْلُهُ (يُثَبِّتُ اللَّهُ الَّذِينَ آمَنُوا بِالْقَوْلِ الثَّابِتِ فِي الْحَيَاةِ الدُّنْيَا وَفِي الْآخِرَة)
وَفِي رِوَايَةٍ عَنِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ: (يُثَبِّتُ اللَّهُ الَّذِينَ آمَنُوا بِالْقَوْلِ الثَّابِت)
نَزَلَتْ فِي عَذَابِ الْقَبْرِ يُقَالُ لَهُ: مَنْ رَبك؟ فَيَقُول: رَبِّي الله ونبيي مُحَمَّد