A British court has ruled that Johnny Depp is in breach of a court order for failing to disclose texts that allegedly show him trying to get hold of drugs.

The ruling by Judge Andrew Nicol Monday was made as part of the actor’s libel action against Rupert Murdoch’s The Sun newspaper, to be heard at the Royal Courts of Justice in London next month. The case relates to an article describing Depp as a “wife beater,” referring to allegations made by his ex-wife, actress Amber Heard, that he was violent toward her, a claim he denies.

On Thursday, the tabloid’s legal team asked the judge to drop the case. Their attorney, Adam Wolanski, said Depp was in breach of a court order because he had not handed over what Wolanski called “Australian drug texts,” sent between Depp and his assistant, Nathan Holmes.

The messages were sent in late February and early March 2015, shortly before what Heard claims was “a three-day ordeal of physical assaults” during a stay in Australia, while he was allegedly taking MDMA, also known as ecstasy, and drinking heavily. The defense claims the texts — which refer to “happy pills” and “whitey stuff” — prove that Depp was trying to procure drugs at the time.

Depp denies that he took the drugs.

His attorney, David Sherborne, argued that the texts did not relate to the allegations of violence, and so were not relevant to the case. In his ruling on Monday, Nicol disagreed with this view.

The judge said: “The Australian drug texts were adverse to the claimant’s pleaded case and/or were supportive of the defendants’ pleaded case.” However, he did not strike out Depp’s legal claim.

The trial is due to begin on July 7, with Depp, Heard and Depp’s former partners Vanessa Paradis and Winona Ryder expected to give evidence.

In 2016, Heard obtained a restraining order against Depp after accusing him of abuse, which he denied.

In addition to the alleged incident in Australia, The Sun’s defense team will refer to 13 separate allegations of domestic violence incidents between early 2013 and May 2016.