createUser(); $payment = new Payment($user, 100_000, 'mellat', Payment::TYPE_APPOINTMENT); $this->em->persist($payment); $breakdown = new FinancialBreakdown( $payment, FinancialBreakdown::SOURCE_APPOINTMENT, $user, 100_000, 0, '0.00', 0, 100_000, '10.00', 10_000, 90_000, null, null, null, ); $this->em->persist($breakdown); $this->em->flush(); $this->em->remove($payment); $this->expectException(ForeignKeyConstraintViolationException::class); $this->em->flush(); } }