Al-'Ankabut 29:10
وَمِنَ ٱلنَّاسِ مَن يَقُولُ ءَامَنَّا بِٱللَّهِ فَإِذَآ أُوذِىَ فِى ٱللَّهِ جَعَلَ فِتْنَةَ ٱلنَّاسِ كَعَذَابِ ٱللَّهِ وَلَئِن جَآءَ نَصْرٌ مِّن رَّبِّكَ لَيَقُولُنَّ إِنَّا كُنَّا مَعَكُمْ ۚ أَوَلَيْسَ ٱللَّهُ بِأَعْلَمَ بِمَا فِى صُدُورِ ٱلْعَـٰلَمِينَ
Wamina annasi man yaqoolu amannabillahi fa-itha oothiya fee AllahijaAAala fitnata annasi kaAAathabi Allahiwala-in jaa nasrun min rabbika layaqoolunna innakunna maAAakum awa laysa Allahu bi-aAAlama bimafee sudoori alAAalameen
And of the people are some who say, "We believe in Allāh," but when one [of them] is harmed for [the cause of] Allāh, he considers the trial [i.e., harm] of the people as [if it were] the punishment of Allāh. But if victory comes from your Lord, they say, "Indeed, We were with you." Is not Allāh most knowing of what is within the breasts of the worlds [i.e., all creatures]?
Among men there are those who say, “We believe in Allah”, but when they are persecuted in (the way of) Allah, they take the persecution of men, as equal to the punishment of Allah. And should any help come from your Lord, they will certainly say, “We were with you.” Is it not that Allah knows well what lies in the hearts of the people of all the worlds?