A person present in court or before a judicial officer may be required to testify in the same manner as if the person were in attendance before the court or officer on a subpoena.