1
0
mirror of synced 2025-02-02 13:31:45 +03:00

Additional assertion to check that unreferenced objects are not in UOW.

This commit is contained in:
Mathieu De Zutter 2016-03-01 19:51:38 +01:00 committed by Marco Pivetta
parent b0e4e3eda4
commit a3d93afc4f

View File

@ -22,11 +22,19 @@ class OidReuseTest extends OrmFunctionalTestCase
public function testOidReuse() public function testOidReuse()
{ {
$uow = $this->_em->getUnitOfWork();
$reflexion = new \ReflectionClass(get_class($uow));
$originalEntityDataProperty = $reflexion->getProperty('originalEntityData');
$originalEntityDataProperty->setAccessible(true);
$user = new CmsUser(); $user = new CmsUser();
$oid = spl_object_hash($user);
$this->_em->merge($user); $this->_em->merge($user);
$user = null; $user = null;
$this->assertArrayNotHasKey($oid, $originalEntityDataProperty->getValue($uow));
$user = new CmsUser(); $user = new CmsUser();
$this->_em->persist($user); $this->_em->persist($user);
} }