From fdb2af07e78d7793eae9c8b04e8ab1032ab107fb Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sun, 27 Nov 2016 18:21:35 +0100 Subject: [PATCH] #6017 hardened `clear()` logic, which now ensures that persisted entries are correctly cleared --- tests/Doctrine/Tests/ORM/UnitOfWorkTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php b/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php index a90b6d191..ef321e761 100644 --- a/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php +++ b/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php @@ -380,6 +380,11 @@ class UnitOfWorkTest extends OrmTestCase { $entity = new Country(456, 'United Kingdom'); + $this->_unitOfWork->persist($entity); + + $this->assertTrue($this->_unitOfWork->isInIdentityMap($entity)); + $this->assertTrue($this->_unitOfWork->isScheduledForInsert($entity)); + $this->_unitOfWork->clear(); $this->assertFalse($this->_unitOfWork->isInIdentityMap($entity));