8000 #1338 DDC-3619 - moved test to unit of work tests · symfonyaml/orm@1e38d7d · GitHub
[go: up one dir, main page]

Skip to content

Commit 1e38d7d

Browse files
committed
doctrine#1338 DDC-3619 - moved test to unit of work tests
1 parent bac6570 commit 1e38d7d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/Doctrine/Tests/ORM/UnitOfWorkTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,21 @@ public function testLockWithoutEntityThrowsException()
229229
$this->setExpectedException('InvalidArgumentException');
230230
$this->_unitOfWork->lock(null, null, null);
231231
}
232+
233+
public function testRemovedAndRePersistedEntitiesAreInTheIdentityMapAndAreNotGarbageCollected()
234+
{
235+
$entity = new ForumUser();
236+
$entity->id = 123;
237+
238+
$this->_unitOfWork->registerManaged($entity, array('id' => 123), array());
239+
$this->assertTrue($this->_unitOfWork->isInIdentityMap($entity));
240+
241+
$this->_unitOfWork->remove($entity);
242+
$this->assertFalse($this->_unitOfWork->isInIdentityMap($entity));
243+
244+
$this->_unitOfWork->persist($entity);
245+
$this->assertTrue($this->_unitOfWork->isInIdentityMap($entity));
246+
}
232247
}
233248

234249
/**

0 commit comments

Comments
 (0)
0