YB
sqs://
Size: a a a
YB
sqs://
JB
YB
YB
JB
IY
ИС
YB
$entity = $this->entityManager->getRepository(SomeClass)->...
if (null === $entitty) {
throw new Exception
}
$otherEntity = $this->entityManager->getRepository(SomeOtherClass)->...
if (null === $otherEntity) {
throw new Exception
}
this->entityManager->getRepository(SomeThirdClass)->...
$mockEntityManager->expects(self::once())->method('getRepository')->with(SomeClass)...
$mockEntityManager->expects(self::never())->method('getRepository')->with(SomeOtherClass)...
ИС
VS
$entity = $this->entityManager->getRepository(SomeClass)->...
if (null === $entitty) {
throw new Exception
}
$otherEntity = $this->entityManager->getRepository(SomeOtherClass)->...
if (null === $otherEntity) {
throw new Exception
}
this->entityManager->getRepository(SomeThirdClass)->...
$mockEntityManager->expects(self::once())->method('getRepository')->with(SomeClass)...
$mockEntityManager->expects(self::never())->method('getRepository')->with(SomeOtherClass)...
IY
YB
VS
VS
$entity = $this->entityManager->getRepository(SomeClass)->...
if (null === $entitty) {
throw new Exception
}
$otherEntity = $this->entityManager->getRepository(SomeOtherClass)->...
if (null === $otherEntity) {
throw new Exception
}
this->entityManager->getRepository(SomeThirdClass)->...
$mockEntityManager->expects(self::once())->method('getRepository')->with(SomeClass)...
$mockEntityManager->expects(self::never())->method('getRepository')->with(SomeOtherClass)...
YB
AA
YB
@ORM\Entity(repositoryClass="SomeEntityRepository")
DT
VS
$em->getRepo($class)->find($id). throw Exception.Лучше в мидлварах разрулить такое
VS
@ORM\Entity(repositoryClass="SomeEntityRepository")