Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:20904Abū ʿAbdullāh al-Ḥāfiẓ Fīmā Ajāz Lī Riwāyatah ʿAnh > Abū al-ʿAbbās Muḥammad b. Yaʿqūb > al-Rabīʿ

[Machine] Because he sees it as permissible to shed blood or to take someone's wealth, his testimony is rejected as false. Or, among them may be someone who allows himself to give testimony for a man whom he trusts, so he swears for him with the right and testifies on his behalf without being present or hearing it. In this case, his testimony is rejected due to his misuse of testimony with falsehood. Or, among them may be someone who clearly distinguishes another man who differs from him, showing enmity towards him. In this case, his testimony is rejected due to his biased hostility.  

البيهقي:٢٠٩٠٤قَالَ أَبُو عَبْدِ اللهِ الْحَافِظُ فِيمَا أَجَازَ لِي رِوَايَتَهُ عَنْهُ حَدَّثَنَا أَبُو الْعَبَّاسِ مُحَمَّدُ بْنُ يَعْقُوبَ أنبأ الرَّبِيعُ قَالَ قَالَ الشَّافِعِيُّ فِي كِتَابِ أَدَبِ الْقَاضِي إِلَّا أَنْ يَكُونَ مِنْهُمْ مَنْ يُعْرَفُ بِاسْتِحْلَالِ شَهَادَةِ الزُّورِ عَلَى الرَّجُلِ

لِأَنَّهُ يَرَاهُ حَلَالَ الدَّمِ أَوْ حَلَالَ الْمَالِ فَتُرَدُّ شَهَادَتُهُ بِالزُّورِ أَوْ يَكُونُ مِنْهُمْ مَنْ يَسْتَحِلُّ أَوْ يَرَى الشَّهَادَةَ لِلرَّجُلِ إِذَا وَثِقَ بِهِ فَيَحْلِفُ لَهُ عَلَى حَقِّهِ وَيَشْهَدُ لَهُ بِالْبَتِّ بِهِ وَلَمْ يَحْضُرْهُ وَلَمْ يَسْمَعْهُ فَتُرَدُّ شَهَادَتُهُ مِنْ قِبَلِ اسْتِحْلَالِهِ الشَّهَادَةَ بِالزُّورِ أَوْ يَكُونُ مِنْهُمْ مَنْ يُبَايِنُ الرَّجُلَ الْمُخَالِفَ لَهُ مُبَايَنَةَ الْعَدَاوَةِ لَهُ فَتُرَدُّ شَهَادَتُهُ مِنْ جِهَةِ الْعَدَاوَةِ