Imam al-Shafi'i (may Allah have mercy on him) said: "Whoever drinks anything of wine (khamr), while knowing that it is khamr, his testimony is to be rejected, whether he became intoxicated or not, because its prohibition is a nass (explicit text) in the Book of Allah."
And regarding drinks other than khamr, a large amount of which intoxicates, he said: "Such a person, in our view, is in error by drinking it and sinful because of it, but his testimony is not rejected because of it." That is, because there is a difference of opinion about it.
Imam al-Shafi'i (may Allah have mercy on him) said: "(This ruling holds) as long as he does not become intoxicated by it; then when he becomes intoxicated by it, his testimony is rejected, because intoxication is forbidden according to all the people of Islam."
Abdullah bin Shaddad narrates that Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) said: Wine was forbidden in itself, whether a little or much, and (so is) intoxication from every drink. From this and things like it arose the doubt of the one who permitted a small amount of the other drinks. As for us, we do not permit even a little of that whose large amount intoxicates.
(b) Sayyiduna Sa'd bin Abi Waqqas (may Allah be pleased with him), Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) and other Companions narrate from the Prophet (peace and blessings be upon him) that he (peace and blessings be upon him) said: "I forbid you a little of that whose large amount intoxicates," and said: "Whatever intoxicates in a large amount, a small amount of it is also forbidden," and said: "Every intoxicant is wine and every intoxicant is forbidden." In this hadith of Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) it is also narrated: "and the intoxicating (amount) of every drink."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الشهادات / 20947