Employees in California have broad protections for testifying under a subpoena because ignoring a subpoena or lying under oath may be crimes. A typical employer has an interest in an employee not testifying against the employer, and not missing work to testify in any matter whether it is related to the employer or not.
Fortunately, California provides employees a protected right to take time off work to appear as a witness in any judicial proceeding in compliance with a subpoena or court order. Examples of judicial proceedings include any deposition under oath out of court or a hearing in court.
If an employer fires, threatens to fire, demotes, suspends, discriminates, or retaliates against an employee in the terms and conditions of employment for taking time off to testify truthfully in a judicial proceeding, that employee is entitled to get her job back and receive the lost wages and benefits resulting from the employer's retaliation.