Question:
What is the ruling on a person who knowingly refuses to give testimony?
Answer:
Whoever knows about a matter and is asked to give testimony must give it; concealing testimony without a valid reason is a sin.
وَلَا تَكْتُمُوا الشَّهَادَةَ وَمَنْ يَكْتُمْهَا فَإِنَّهُ آثِمٌ قَلْبُهُ وَاللَّهُ بِمَا تَعْمَلُونَ عَلِيمٌ
Reference: ﴿Al-Baqarah: 283﴾
Do not conceal testimony. Whoever conceals it, his heart is sinful, and Allah knows well what you do.