Sahih Muslim 59
Sahih Muslim · Book 1: The Book of Faith · The characteristics of the hypocrite
It is reported on the authority of Abu Huraira that the Messenger of Allah (may peace and blessings of Allah be upon him) made observations like them embodied in the hadith narrated by Yahya b. Muhammad on the authority of 'Ala', and added to it:
وَحَدَّثَنِي أَبُو نَصْرٍ التَّمَّارُ ، وَعَبْدُ الأَعْلَى بْنُ حَمَّادٍ ، قَالاَ حَدَّثَنَا حَمَّادُ بْنُ سَلَمَةَ ، عَنْ دَاوُدَ بْنِ أَبِي هِنْدٍ ، عَنْ سَعِيدِ بْنِ الْمُسَيَّبِ ، عَنْ أَبِي هُرَيْرَةَ ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم بِمِثْلِ حَدِيثِ يَحْيَى بْنِ مُحَمَّدٍ عَنِ الْعَلاَءِ ذَكَرَ فِيهِ " وَإِنْ صَامَ وَصَلَّى وَزَعَمَ أَنَّهُ مُسْلِمٌ " .
even if he observed fast and prayed and asserted that he was a Muslim.