Fix PostgreSQL test-failure. UnitOfWork#getEntityState() produced exists() queries because of unmanaged entity passed as parameter to AbstractQuery#setParameter(), thereby skewing the sql count
This commit is contained in:
parent
5adc8bec58
commit
eaae1f222f
@ -70,12 +70,10 @@ class HydrationCacheTest extends OrmFunctionalTestCase
|
|||||||
public function testHydrationParametersSerialization()
|
public function testHydrationParametersSerialization()
|
||||||
{
|
{
|
||||||
$cache = new ArrayCache();
|
$cache = new ArrayCache();
|
||||||
$user = new CmsUser();
|
|
||||||
$user->id = 1;
|
|
||||||
|
|
||||||
$dql = "SELECT u FROM Doctrine\Tests\Models\Cms\CmsUser u WHERE u.id = ?1";
|
$dql = "SELECT u FROM Doctrine\Tests\Models\Cms\CmsUser u WHERE u.id = ?1";
|
||||||
$query = $this->_em->createQuery($dql)
|
$query = $this->_em->createQuery($dql)
|
||||||
->setParameter(1, $user)
|
->setParameter(1, $userId = 1)
|
||||||
->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache));
|
->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache));
|
||||||
|
|
||||||
$query->getResult();
|
$query->getResult();
|
||||||
@ -83,7 +81,7 @@ class HydrationCacheTest extends OrmFunctionalTestCase
|
|||||||
$c = $this->getCurrentQueryCount();
|
$c = $this->getCurrentQueryCount();
|
||||||
|
|
||||||
$query->getResult();
|
$query->getResult();
|
||||||
|
|
||||||
$this->assertEquals($c, $this->getCurrentQueryCount(), "Should not execute query. Its cached!");
|
$this->assertEquals($c, $this->getCurrentQueryCount(), "Should not execute query. Its cached!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user