예제 #1
0
 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);
 }
예제 #2
0
 /**
  * Removes an entity
  *
  * @param Delete $command
  */
 public function handle(Delete $command)
 {
     $entity = $command->getEntity();
     $this->em->remove($entity);
     $this->em->flush();
 }