From c4019d96b9f369ef1bc4c651c2eea0917ace1426 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Tue, 27 Jan 2015 09:03:36 +0100 Subject: [PATCH] #1169 DDC-3343 - when a deletion fails for some reason, related cache entries should be evicted to avoid collisions with DB state --- .../Tests/ORM/Functional/SecondLevelCacheTest.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheTest.php b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheTest.php index 37dadd26c..56735840a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheTest.php @@ -296,10 +296,12 @@ class SecondLevelCacheTest extends SecondLevelCacheAbstractTest $this->_em->clear(); - $this->assertTrue($this->cache->containsEntity(Country::CLASSNAME, $countryId)); + $this->assertFalse( + $this->cache->containsEntity(Country::CLASSNAME, $countryId), + 'Removal attempts should clear the cache entry corresponding to the entity' + ); - $country = $this->_em->find(Country::CLASSNAME, $countryId); - $this->assertInstanceOf(Country::CLASSNAME, $country); + $this->assertInstanceOf(Country::CLASSNAME, $this->_em->find(Country::CLASSNAME, $countryId)); } public function testCachedNewEntityExists()