Al-Ankabut - 29:10

وَمِنَ النَّاسِ مَن يَقُولُ آمَنَّا بِاللَّهِ فَإِذَا أُوذِيَ فِي اللَّهِ جَعَلَ فِتْنَةَ النَّاسِ كَعَذَابِ اللَّهِ وَلَئِن جَاء نَصْرٌ مِّن رَّبِّكَ لَيَقُولُنَّ إِنَّا كُنَّا مَعَكُمْ أَوَلَيْسَ اللَّهُ بِأَعْلَمَ بِمَا فِي صُدُورِ الْعَالَمِينَ
[29:10]
And among men is he who says: We believe in Allah; but when he is persecuted in (the way of) Allah he thinks the persecution of men to be as the chastisement of Allah; and if there come assistance from your Lord, they would most certainly say: Surely we were with you. What! is not Allah the best knower of what is in the breasts of mankind.
Then there are among men such as say, "We believe in Allah"; but when they suffer affliction in (the cause of) Allah, they treat men's oppression as if it were the Wrath of Allah! And if help comes (to thee) from thy Lord, they are sure to say, "We have (always) been with you!" Does not Allah know best all that is in the hearts of all creation?
Of mankind is he who saith: We believe in Allah, but, if he be made to suffer for the sake of Allah, he mistaketh the persecution of mankind for Allah's punishment; and then, if victory cometh from thy Lord, will say: Lo! we were with you (all the while). Is not Allah Best Aware of what is in the bosoms of (His) creatures?