function it_handles_a_delete_command(Entity $entity, Delete $command, EntityManagerInterface $em) { $command->getEntity()->willReturn($entity); $em->remove($entity)->shouldBeCalled(); $em->flush()->shouldBeCalled(); $this->handle($command); }
/** * Removes an entity * * @param Delete $command */ public function handle(Delete $command) { $entity = $command->getEntity(); $this->em->remove($entity); $this->em->flush(); }