
666 S.W.2d 510 (1983)
BERT WHEELER'S, INC., Relator,
v.
The Honorable Carolyn L. RUFFINO, Respondent.
No. 01-83-0532-CV.
Court of Appeals of Texas, Houston (1st Dist.).
November 23, 1983.
Rehearing Denied February 16, 1984.
*511 Karl C. Hoppess, Robert J. Filteau, Houston, for relator.
William R. Vance, Houston, for Texas Municipal Power Agency.
Before WARREN, DOYLE and DUGGAN, JJ.

OPINION
WARREN, Justice.
Relator seeks a writ of mandamus to compel the Honorable Carolyn Ruffino, Judge of the County Court of Law of Brazos County, to reinstate Karl Hoppess as his attorney in a condemnation suit.
Texas Municipal Power Agency (T.M.P. A.), the real party in interest, is a municipal corporation and a political subdivision of the State of Texas, possessing the right of eminent domain. Bert Wheeler, Inc., is the owner of a tract of property in Brazos County, which T.M.P.A. seeks to condemn for a power line easement.
In January, 1979, T.M.P.A. attempted to purchase a 5.580 acre power line easement across a large tract of land owned by relator. The negotiations continued until October, 1979, when T.M.P.A. filed a petition in condemnation in the County Court of Law of Brazos County. During the period before the petition was filed, various lawyers and representatives of T.M.P.A. negotiated with various representatives of relator and four different lawyers representing him, on several matters, including the necessity of taking, the location of the line, the height of the wire, the location of the guy wires, and the price to be paid for the easement.
On August 30, 1979, Dave Morris, a contract landman for T.M.P.A., offered John Lawrence, a lawyer for relator, $111,600 for the easement. Relator did not immediately accept the offer.
On September 13, Karl Hoppess was hired by relator to continue the negotiations. At a September 20 meeting between Mr. Hoppess and several representatives of T.M.P.A., the specifications of the easements were discussed and apparently a general agreement was reached. However the consideration to be paid for the easement was not discussed. Immediately after the meeting, an attorney for T.M.P.A., who was not present at the meeting, informed Mr. Hoppess that the $111,600 offer had been withdrawn and that T.M.P.A. was willing to pay only $81,000 for the easement.
On September 27, Mr. Hoppess wrote a representative of T.M.P.A. and informed him that relator would accept the $111,600 offer. The representative replied to Mr. Hoppess by letter that the original offer was not available, and again made an offer of $81,000.00.
On October 24, 1979, T.M.P.A. filed a petition for condemnation, and in July, 1982, filed a motion for partial summary judgment, seeking the court's judgment that all issues in the case, except damages, were proved as a matter of law.
*512 Attached to the its response to T.M.P. A.'s motion for partial summary judgment was a sworn affidavit of relator's attorney, Karl Hoppess, reciting the history of his negotiations with T.M.P.A. The testimony attempted to refute T.M.P.A.'s claim of good faith negotiations and intimated an abuse of discretion by T.M.P.A. In answer to T.M.P.A.'s interrogatories, Mr. Hoppess was listed by T.M.P.A. as a witness who would appear at trial on behalf of relator.
On April 15, 1983, the court granted a partial summary judgment decreeing that all issues in the case were resolved as a matter of law except the following:
(1) whether or not Plaintiff (appellee) negotiated in good faith;
(2) whether or not Plaintiff (appellee) abused its discretion in determining the interest in land to be condemned; and,
(3) the amount of damages.
On April 22, T.M.P.A. filed a motion to disqualify Mr. Hoppess as the attorney for relator, alleging that by remaining as relator's attorney he would be in violation of the State Bar of Texas Disciplinary Rule DR5-102, since Hoppess was to be a witness in the case.
After a hearing, at which Mr. Hoppess stipulated that he intended to appear as a witness at the trial, the court granted relator's motion to disqualify.
Thereafter, Mr. Hoppess filed a motion to reinstate himself as the attorney. At the hearing on that motion, Mr. Hoppess informed the court that his client did not want him to testify, and that if he were reinstated he would neither testify nor offer to the court or to the jury any evidence relating to his personal knowledge. He also withdrew his previous stipulation concerning his appearance as a witness. At that hearing, Mr. Vance, the attorney for T.M.P.A., told the court that he still opposed the motion to reinstate, because Mr. Hoppess was still a material witness as to whether T.M.P.A. negotiated with relator in good faith. He further informed the court that since Mr. Hoppess's sworn summary judgment affidavit showed that T.M. P.A.'s offer of $111,600 was withdrawn before relator ever authorized him to accept it, T.M.P.A. would be placed in a position in which it might have to call him to testify on the good faith issue and potentially to give testimony prejudicial to his (Hoppess') own client. The court refused to reinstate Mr. Hoppess.
Our first question is whether we have the power to issue a writ of mandamus to order the trial judge to reinstate Mr. Hoppess.
Since June 19, 1983, our jurisdiction over causes subject to mandamus has been enlarged such that it is virtually the same as that of the Supreme Court of Texas. Tex. Rev.Civ.Stat.Ann. art. 1824, § 3 (Vernon Supp. 1983). Therefore, former cases pertaining to the mandamus jurisdiction of the Supreme Court would now be applicable to our jurisdiction.
A writ of mandamus may issue in a proper case to correct a clear abuse of discretion, particularly when the remedy by way of appeal is inadequate. West v. Solito, 563 S.W.2d 240 (Tex.1978); Crane v. Tunks, 160 Tex. 182, 328 S.W.2d 434 (1959).
Relator contends that a judge's refusal to reinstate a lawyer so as to act as the attorney of record constitutes a clear abuse of discretion when a disciplinary rule of the State Bar of Texas is not being transgressed. We agree with this contention, but we cannot agree that it is applicable to the situation with which we are confronted.
The order disqualifying Hoppess apparently was based on alleged violations of Disciplinary Rule 5-101 and 5-102 and Ethical Considerations 5-9 and 5-10, Tex. State Bar Rules (Vernon 1973).
Disciplinary Rule 5-102 provides that a lawyer shall not, unless one of four exceptions applies, "accept employment in contemplated or pending litigation if he knows or it is obvious that he or a lawyer in his firm ought to be called as a witness on behalf of his client, he must withdraw from the employment."
*513 The four exceptions to Disciplinary Rule 5-101(B), which permit the lawyer to accept or continue employment include:
1. If the testimony will relate solely to an uncontested matter.
2. If the testimony will relate solely to a matter of formality and there is no reason to believe that substantial evidence will be offered in opposition to the testimony.
3. If the testimony will relate solely to the nature and value of legal services rendered in the case by the lawyer or his firm to the client.
4. As to any matter if refusal would work a substantial hardship on the client because of the distinctive value of the lawyer or his firm as counsel in the particular case.
Disciplinary Rule 5-102(B) applies after a lawyer has undertaken employment in contemplated or pending litigation, and later learns, or it becomes obvious, that he or a lawyer in his firm ought to be called as a witness other than on behalf of his client. In such a case the lawyer "may continue the representation until it is apparent that his testimony is or may be prejudicial to his client."
Ethical Consideration 5-10 contains guidelines for the lawyer-witness to consider in determining whether he should serve as counsel:
1. The same basic considerations govern both the initial decision to refuse to accept employment as counsel and the decision, where the problem surfaces later, to withdraw or to continue as counsel.
2. The attorney also need not withdraw as counsel if it is unlikely that he will be called as a witness because his testimony would be "merely cumulative ..."
3. Further, an attorney may serve as counsel even though he will probably be a witness on a contested issue in the "exceptional situation" in which his refusal to so serve would be manifestly unfair to the client.
4. In deciding whether to serve or not to serve as counsel, the attorney should consider "the personal or financial sacrifice of the client that may result from his refusal of employment ..., the materiality of his testimony, and the effectiveness of his representation in view of his personal involvement."
5. It also "should be clear that refusal or withdrawal will impose an unreasonable hardship upon the client before the lawyer accepts or continues the employment."
6. Finally, doubts should be resolved in favor of his testifying and against his serving as counsel.
Several reasons have been advanced for the rule prohibiting the lawyer from testifying. See, Lewis, J., "The Ethical Dilemma of Testifying Advocate: Fact or Fancy?" 19 Hous.L.Rev. 75 (1981). The attorney may be more impeachable for interest and, therefore, a less effective witness. His role as an advocate may handicap the opposing counsel in challenging the credibility of the testifying advocate, or it may place the testifying advocate in the unseemly and ineffective position of arguing his own credibility. Finally, the roles of advocate and witness are inconsistent, because the function of an advocate is to advance his client's cause, and that of a witness is to state facts objectively.
We conclude that the trial court did not abuse its discretion in deciding to disqualify Mr. Hoppess, after hearing T.M.P. A.'s motion to disqualify. His stipulation that he would appear as a witness on behalf of his client, without a showing that this testimony did not fall within one of the four exceptions made in DR. 5-101(B), is an admission of a contemplated violation of DR. 5-102.
Neither party questions the duty of the court to enforce the disciplinary Rules, and there is authority stating that there is such a duty. State Bar of Texas v. Edwards, 646 S.W.2d 543 (Tex.App.-Houston [1st Dist.] 1982, writ ref'd n.r.e.).
*514 The question is whether the agreement by Hoppess and relator, to forego calling Hoppess as a witness, cures any potential violation or makes the possibility of a violation so remote or unlikely that it should not be considered a potential violation?
Disciplinary Rule 5-102(A) requires that a lawyer withdraw from representation in a trial if he learns or it is obvious that he or a lawyer in his firm ought to be called as a witness on behalf of his client unless the testimony is excepted under DR. 5-101(B)(1) through (4).
Disciplinary Rule 5-102(B) provides that when a lawyer learns or it is obvious that he may be called as a witness other than on behalf of his client, he may continue the representation until it is apparent that his testimony is or may be prejudicial to his client.
When considering the motion to reinstate, the judge was aware of the information contained in Hoppess's summary judgment affidavit. She was also aware of opposing counsel's contentions that it may call Hoppess to testify and that the testimony would be prejudicial to relator's position regarding "good faith". Good faith would be a material issue in the case, because if the jury decided that T.M.P.A. failed to negotiate in good faith, then the court would lose jurisdiction over the entire cause.
We recognize that the denial of relator's right to have Hoppess represent him at trial will likely create some hardship to relator, and that any remedy by appeal may be inadequate. We believe that this is true in most cases where a lawyer is forced to withdraw after spending several years preparing a case for trial. Also, there is a clear danger of such a tactic being used by an opposing counsel to disqualify the skillful, the stubborn, or the perpetual adversary. Therefore, appellate courts must look carefully to the circumstances of each case in deciding whether mandamus should issue to prevent an abuse of discretion by the trial court. We hold that in this case an abuse of discretion is not demonstrated by the record.
The writ is denied.

ON MOTION FOR REHEARING
WARREN, Justice.
First, we feel compelled to expressly deny relator's allegations that by our opinion we have branded its attorney, Karl Hoppess, an unethical practitioner and that we have castigated him. To the contrary, we are sympathetic with relator and counsel because of the hardship, inconvenience, and possible disadvantage caused by the situation.
Our opinion held that:
(1) the trial court has a duty to enforce disciplinary rules;
(2) mandamus will lie to correct a clear abuse of discretion by the trial court in its enforcement of those rules; and,
(3) the trial court did not abuse its discretion in refusing to reinstate relator's attorney as the attorney of record.
We do not hold that it is a violation of the Disciplinary Rules for an attorney who has represented a client in a condemnation case in the negotiation stage to represent the client also at trial, even though "good faith" is in issue.
In this case the attorney voluntarily injected himself into the case as a witness on a material issue, which is a violation of Disciplinary Rule 5-102.
After the trial court declined to apply an exception to DR 5-102 and removed Mr. Hoppess, and after his client agreed that Hoppess would not appear as a witness, and filed a motion to reinstate Hoppess, T.M.P.A. then declared that it would call Hoppess as a witness and resisted the motion to reinstate.
It was the trial judge's duty to determine whether, under the facts, an exception under DR 5-101(B)(4), or DR 5-102 would apply, thus allowing Hoppess to continue *515 as attorney of record. She refused to apply any of the exceptions.
In reaching its decision, the trial court necessarily had to consider the facts contained in the record and apply the law to those facts. We may not substitute our opinion for that of the trial judge unless there was an abuse of discretion or unless the trial judge erroneously applied the law to the facts.
The motion for rehearing is overruled.
