Additional assertion to check that unreferenced objects are not in UOW.
This commit is contained in:
parent
b0e4e3eda4
commit
a3d93afc4f
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user