A female police officer was repeatedly punched and had her glasses broken when she arrested a man for drug offences, a court heard today.