Elissa Ennis, former girlfriend of San Francisco 49ers linebacker Reuben Foster, center, walks out of Santa Clara County Superior Court with her attorney Stephanie Rickard, left, after testifying in Foster's preliminary hearing, Thursday, May 17, 2018, in San Jose, Calif. Foster pleaded not guilty Tuesday, May 8, 2018, to charges stemming from allegations that he attacked Ennis in their home in February. (AP Photo/Marcio Jose Sanchez)

Elissa Ennis, former girlfriend of San Francisco 49ers linebacker Reuben Foster, center, walks out of Santa Clara County Superior Court with her attorney Stephanie Rickard, rear, after testifying in Foster's preliminary hearing, Thursday, May 17, 2018, in San Jose, Calif. Foster pleaded not guilty Tuesday, May 8, 2018, to charges stemming from allegations that he attacked Ennis in their home in February. (AP Photo/Marcio Jose Sanchez)

Elissa Ennis, former girlfriend of San Francisco 49ers linebacker Reuben Foster, walks out of Santa Clara County Superior Court after testifying in Foster's preliminary hearing, Thursday, May 17, 2018, in San Jose, Calif. Foster pleaded not guilty Tuesday, May 8, 2018, to charges stemming from allegations that he attacked Ennis in their home in February. (AP Photo/Marcio Jose Sanchez)

Elissa Ennis, former girlfriend of San Francisco 49ers linebacker Reuben Foster, center, walks out of Santa Clara County Superior Court with her attorney Stephanie Rickard, left, after testifying in Foster's preliminary hearing, Thursday, May 17, 2018, in San Jose, Calif. Foster pleaded not guilty Tuesday, May 8, 2018, to charges stemming from allegations that he attacked Ennis in their home in February. (AP Photo/Marcio Jose Sanchez)

San Francisco 49ers linebacker Reuben Foster, right, leaves the Santa Clara County Superior Court, with his attorney Joshua Bentley after a preliminary hearing stemming from domestic violence accusations against Foster Thursday, May 17, 2018, in San Jose, Calif. Foster's ex-girlfriend, Elissa Ennis, recanted allegations Thursday that Foster physically assaulted her. She testified that she lied to authorities about the domestic assault to get back at Foster for breaking up with her. (AP Photo/Marcio Jose Sanchez)

SAN JOSE, Calif. — The former girlfriend of Reuben Foster testified at a preliminary hearing Thursday that she lied to police when she said the San Francisco 49ers linebacker attacked her, allegations that led to a domestic violence case against him.

Elissa Ennis testified she lied because she wanted retribution after Foster tried to end their relationship, saying she was angry “and I wanted to end him.” When asked by prosecutor Kevin Smith if Foster ever hit her, Ennis replied, “No, sir. Not once.”

Foster was arrested after Ennis told police he dragged her by her hair, physically threw her out of their house, and punched her in the head eight to 10 times in February. He has been charged with domestic violence with an allegation that he inflicted great bodily injury, forcefully attempting to prevent a victim from reporting a crime, and possession of an assault weapon. Foster pleaded not guilty last week.

Ennis subsequently issued a statement through her attorney saying her injuries, including a ruptured eardrum, were the result of a fight with another woman.

Prosecutors have said they will continue to pursue the case even if Ennis does not cooperate with the investigation. The prosecution said Ennis’ testimony couldn’t be trusted given inconsistencies throughout.

Judge Nona Klippen said she will rule Wednesday on whether the case should continue to trial.

Ennis, who testified against the advice of her attorney, said in court Thursday that she wanted to testify to “do the right thing.”

She said Foster broke up with her after she got into the fight with another woman during a road rage incident in San Francisco. A 22-second video clip of that fight was presented as evidence in the case.

Ennis said she initially wanted to sue Foster. “It was all about the money,” she said.

Ennis also testified that she stole more than $8,000 in cash from Foster, two Rolex watches and designer clothing.

During cross examination by Foster’s attorney Joshua Bentley, Ennis said she went to jail in 2011 for falsely accusing an ex-boyfriend of domestic violence.

If convicted of all charges, Foster could face up to 11 years in prison. Foster remains a member of the 49ers although the team hasn’t allowed him to participate in the offseason program while his case is ongoing.