In any proceeding for the examination of a third person under this article, witnesses, including the defendant, may be required to appear and testify before the court or referee in the same manner as upon the trial of an issue.
Ca. Civ. Proc. Code § 491.120