1
0
mirror of synced 2024-12-05 03:06:05 +03:00

#1338 DDC-3619 - moved test to unit of work tests

This commit is contained in:
Marco Pivetta 2015-03-17 22:30:06 +00:00
parent b492d61398
commit b721841c73

View File

@ -302,6 +302,21 @@ class UnitOfWorkTest extends \Doctrine\Tests\OrmTestCase
$this->_unitOfWork->computeChangeSet($metadata, $user);
}
public function testRemovedAndRePersistedEntitiesAreInTheIdentityMapAndAreNotGarbageCollected()
{
$entity = new ForumUser();
$entity->id = 123;
$this->_unitOfWork->registerManaged($entity, array('id' => 123), array());
$this->assertTrue($this->_unitOfWork->isInIdentityMap($entity));
$this->_unitOfWork->remove($entity);
$this->assertFalse($this->_unitOfWork->isInIdentityMap($entity));
$this->_unitOfWork->persist($entity);
$this->assertTrue($this->_unitOfWork->isInIdentityMap($entity));
}
/**
* Data Provider
*