Cardi B has testified in a Los Angeles County court, denying allegations that she injured a security guard during her first pregnancy