Generally speaking, lawyer's testimony would be stricken or inadmissible if (1) the client's disclosure happened in the context of (i.e., during) the attorney-client relation between them, and (2) the client does not waive the attorney-client privilege pursuant to that relation. In other words, the testimony a lawyer might provide is not to "infringe" the attorney-client privilege.
For the communications at issue, the requisite context or character of attorney-client relation is palpable from case law and primarily statutory law. For instance, section 4503 of [NY] Civil Practice Law & Rules is in terms of "communication made between the attorney [...] and the client in the course of professional employment" (emphasis added). Similarly, State v. Usrey, 212 P.3d 279 (2009) ("any communication made by the client to him or his advice given to the client in the course of professional employment", emphasis added). See also Rhone-Poulenc Inc. v. Home Indem Co., 32 F.3d 851, 862 (1994) ("in connection with this communication is acting as a lawyer").
Note that the matter does not whatsoever depend on whether the attorney-client relation subsists at the time the lawyer's testimony is sought. If communications pursuant to the attorney-client privilege lost protection once the relation breaks, defeating the privilege would be a matter of persuading, bribing, or ordering a lawyer to stop representing his current client(s).
Examples where courts ruled that the client's disclosure does not pertain to the lawyer's attorney capacity or that the client implicitly waived the privilege are Purdue University v. Wartell, 5 N.E.3d 797 (2014) and Waterfield v. Waterfield 61 N.E.3d 314 (2016), respectively. In such instances, the lawyer's testimony (be it part thereof or in its entirety, accordingly) would constitute admissible evidence.