@@ 171-181 (lines=11) @@ | ||
168 | self::assertEquals('Doctrine 2 Cookbook', $entity->getName()); |
|
169 | } |
|
170 | ||
171 | public function testDoNotInitializeProxyOnGettingTheIdentifier() |
|
172 | { |
|
173 | $id = $this->createProduct(); |
|
174 | ||
175 | /* @var $entity ECommerceProduct|GhostObjectInterface */ |
|
176 | $entity = $this->em->getReference(ECommerceProduct::class , $id); |
|
177 | ||
178 | self::assertFalse($entity->isProxyInitialized(), "Pre-Condition: Object is unitialized proxy."); |
|
179 | self::assertEquals($id, $entity->getId()); |
|
180 | self::assertFalse($entity->isProxyInitialized(), "Getting the identifier doesn't initialize the proxy."); |
|
181 | } |
|
182 | ||
183 | /** |
|
184 | * @group DDC-1625 |
|
@@ 186-196 (lines=11) @@ | ||
183 | /** |
|
184 | * @group DDC-1625 |
|
185 | */ |
|
186 | public function testDoNotInitializeProxyOnGettingTheIdentifier_DDC_1625() |
|
187 | { |
|
188 | $id = $this->createAuction(); |
|
189 | ||
190 | /* @var $entity CompanyAuction|GhostObjectInterface */ |
|
191 | $entity = $this->em->getReference(CompanyAuction::class , $id); |
|
192 | ||
193 | self::assertFalse($entity->isProxyInitialized(), "Pre-Condition: Object is unitialized proxy."); |
|
194 | self::assertEquals($id, $entity->getId()); |
|
195 | self::assertFalse($entity->isProxyInitialized(), "Getting the identifier doesn't initialize the proxy when extending."); |
|
196 | } |
|
197 | ||
198 | public function testDoNotInitializeProxyOnGettingTheIdentifierAndReturnTheRightType() |
|
199 | { |
|
@@ 224-234 (lines=11) @@ | ||
221 | self::assertFalse($entity->isProxyInitialized(), "Getting the identifier doesn't initialize the proxy."); |
|
222 | } |
|
223 | ||
224 | public function testInitializeProxyOnGettingSomethingOtherThanTheIdentifier() |
|
225 | { |
|
226 | $id = $this->createProduct(); |
|
227 | ||
228 | /* @var $entity ECommerceProduct|GhostObjectInterface */ |
|
229 | $entity = $this->em->getReference(ECommerceProduct::class , $id); |
|
230 | ||
231 | self::assertFalse($entity->isProxyInitialized(), "Pre-Condition: Object is unitialized proxy."); |
|
232 | self::assertEquals('Doctrine Cookbook', $entity->getName()); |
|
233 | self::assertTrue($entity->isProxyInitialized(), "Getting something other than the identifier initializes the proxy."); |
|
234 | } |
|
235 | ||
236 | /** |
|
237 | * @group DDC-1604 |