Commit b774c987 authored by zYne's avatar zYne

--no commit message

--no commit message
parent fed8eac7
...@@ -640,7 +640,7 @@ class Doctrine_Hydrate implements Serializable ...@@ -640,7 +640,7 @@ class Doctrine_Hydrate implements Serializable
if ($this->_cache) { if ($this->_cache) {
$dql = $this->getDql(); $dql = $this->getDql();
// calculate hash for dql query // calculate hash for dql query
$hash = strlen($dql) . md5($dql); $hash = strlen($dql) . md5($dql . var_export($params, true));
$cached = $this->_cache->fetch($hash); $cached = $this->_cache->fetch($hash);
......
...@@ -70,5 +70,25 @@ class Doctrine_Query_Cache_TestCase extends Doctrine_UnitTestCase ...@@ -70,5 +70,25 @@ class Doctrine_Query_Cache_TestCase extends Doctrine_UnitTestCase
$this->assertTrue($coll instanceof Doctrine_Collection); $this->assertTrue($coll instanceof Doctrine_Collection);
$this->assertEqual($coll->count(), 8); $this->assertEqual($coll->count(), 8);
} }
public function testResultSetCacheSupportsPreparedStatements()
{
$q = new Doctrine_Query();
$cache = new Doctrine_Cache_Array();
$q->setCache($cache);
$q->select('u.name')->from('User u')->leftJoin('u.Phonenumber p')
->where('u.id = ?');
$coll = $q->execute(array(5));
$this->assertEqual($cache->count(), 1);
$this->assertTrue($coll instanceof Doctrine_Collection);
$this->assertEqual($coll->count(), 1);
$coll = $q->execute(array(5));
$this->assertEqual($cache->count(), 1);
$this->assertTrue($coll instanceof Doctrine_Collection);
$this->assertEqual($coll->count(), 1);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment