コード例 #1
0
 function it_throws_an_exception_if_entity_is_not_found(EntityRepository $entityRepository)
 {
     $entityRepository->find(789)->willReturn(null);
     $this->shouldThrow(\Exception::class)->duringShowEntityNameAction(789);
 }
コード例 #2
0
 /**
  * @Given the entity :entityId does not exists
  */
 public function theEntityDoesNotExists($entityId)
 {
     if ($this->entityRepository->find((int) $entityId)) {
         throw new \LogicException("Entity `{$entityId}` was not expected but it exists");
     }
 }