Merge branch '2.2'
This commit is contained in:
commit
adec530c13
@ -316,7 +316,7 @@ abstract class AbstractQuery
|
||||
|
||||
$this->_queryCacheProfile = $this->_queryCacheProfile
|
||||
? $this->_queryCacheProfile->setLifetime($lifetime)
|
||||
: new QueryCacheProfile($lifetime);
|
||||
: new QueryCacheProfile($lifetime, null, $this->_em->getConfiguration()->getResultCacheImpl());
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -615,7 +615,7 @@ abstract class AbstractQuery
|
||||
{
|
||||
$this->_queryCacheProfile = $this->_queryCacheProfile
|
||||
? $this->_queryCacheProfile->setCacheKey($id)
|
||||
: new QueryCacheProfile(0, $id);
|
||||
: new QueryCacheProfile(0, $id, $this->_em->getConfiguration()->getResultCacheImpl());
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Query;
|
||||
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
use Doctrine\Common\Cache\ArrayCache;
|
||||
|
||||
class QueryTest extends \Doctrine\Tests\OrmTestCase
|
||||
{
|
||||
@ -90,4 +90,15 @@ class QueryTest extends \Doctrine\Tests\OrmTestCase
|
||||
$this->assertEquals('baz', $q->getHint('bar'));
|
||||
$this->assertEquals(array('foo' => 'bar', 'bar' => 'baz'), $q->getHints());
|
||||
}
|
||||
|
||||
/**
|
||||
* @group DDC-1588
|
||||
*/
|
||||
public function testQueryDefaultResultCache()
|
||||
{
|
||||
$this->_em->getConfiguration()->setResultCacheImpl(new ArrayCache());
|
||||
$q = $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a");
|
||||
$q->useResultCache(true);
|
||||
$this->assertSame($this->_em->getConfiguration()->getResultCacheImpl(), $q->getQueryCacheProfile()->getResultCacheDriver());
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user