File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,21 @@ public function testLockWithoutEntityThrowsException()
229
229
$ this ->setExpectedException ('InvalidArgumentException ' );
230
230
$ this ->_unitOfWork ->lock (null , null , null );
231
231
}
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
+ }
232
247
}
233
248
234
249
/**
You can’t perform that action at this time.
0 commit comments