Imam al-Shafi'i (may Allah have mercy on him) said: "Allah, exalted be His praise, says: 'And take two witnesses from among your men.' [Surah al-Baqarah: 282]"
He (Imam al-Shafi'i, may Allah have mercy on him) said: "And by 'our men' is meant our free people, not our slaves, over many of whose affairs their owners have control. Therefore the testimony of a slave is not permissible in any matter, however trivial that matter may be."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الشهادات / Q20607