|
@@ 54-71 (lines=18) @@
|
| 51 |
|
$this->em->clear(); |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
public function testInjectEntityManagerInProxyIfInitializedInUow() |
| 55 |
|
{ |
| 56 |
|
/* @var $emAware DDC2231EntityManagerAwareEntity|GhostObjectInterface */ |
| 57 |
|
$emAware = $this->em->getReference( |
| 58 |
|
DDC2231EntityManagerAwareEntity::class, |
| 59 |
|
$this->persistedEntityManagerAwareEntity->id |
| 60 |
|
); |
| 61 |
|
|
| 62 |
|
self::assertInstanceOf(GhostObjectInterface::class, $emAware); |
| 63 |
|
self::assertInstanceOf(DDC2231EntityManagerAwareEntity::class, $emAware); |
| 64 |
|
self::assertInstanceOf(EntityManagerAware::class, $emAware); |
| 65 |
|
self::assertFalse($emAware->isProxyInitialized()); |
| 66 |
|
self::assertSame($this->em, $emAware->em); |
| 67 |
|
|
| 68 |
|
$emAware->initializeProxy(); |
| 69 |
|
|
| 70 |
|
self::assertSame($this->em, $emAware->em); |
| 71 |
|
} |
| 72 |
|
|
| 73 |
|
public function testInjectEntityManagerInFetchedInstance() |
| 74 |
|
{ |
|
@@ 87-104 (lines=18) @@
|
| 84 |
|
self::assertSame($this->em, $emAware->em); |
| 85 |
|
} |
| 86 |
|
|
| 87 |
|
public function testInjectObjectManagerInProxyIfInitializedInUow() |
| 88 |
|
{ |
| 89 |
|
/* @var $omAware DDC2231ObjectManagerAwareEntity|GhostObjectInterface */ |
| 90 |
|
$omAware = $this->em->getReference( |
| 91 |
|
DDC2231ObjectManagerAwareEntity::class, |
| 92 |
|
$this->persistedObjectManagerAwareEntity->id |
| 93 |
|
); |
| 94 |
|
|
| 95 |
|
self::assertInstanceOf(GhostObjectInterface::class, $omAware); |
| 96 |
|
self::assertInstanceOf(DDC2231ObjectManagerAwareEntity::class, $omAware); |
| 97 |
|
self::assertInstanceOf(ObjectManagerAware::class, $omAware); |
| 98 |
|
self::assertFalse($omAware->isProxyInitialized()); |
| 99 |
|
self::assertSame($this->em, $omAware->om); |
| 100 |
|
|
| 101 |
|
$omAware->initializeProxy(); |
| 102 |
|
|
| 103 |
|
self::assertSame($this->em, $omAware->om); |
| 104 |
|
} |
| 105 |
|
|
| 106 |
|
public function testInjectObjectManagerInFetchedInstance() |
| 107 |
|
{ |