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."
Ibn Abi Najih (may Allah have mercy on him) narrates from Mujahid (may Allah have mercy on him) that in the saying of Allah, the Exalted, 'And take two witnesses from among your men' [Surah al-Baqarah: 282], 'men' (rijal) means free people.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الشهادات / 20607