Commit 5cd993cd authored by zYne's avatar zYne

--no commit message

--no commit message
parent 66731869
......@@ -51,9 +51,35 @@ class Doctrine_Query_Cache_TestCase extends Doctrine_UnitTestCase
$cache = new Doctrine_Cache_Array();
$q->setOption('resultSetCache', $cache);
$q->select('u.name')->from('User u');
$coll = $q->execute();
Doctrine::dump($q->getCachedForm());
$this->assertEqual($cache->count(), 1);
$this->assertTrue($coll instanceof Doctrine_Collection);
$this->assertEqual($coll->count(), 8);
$coll = $q->execute();
$this->assertEqual($cache->count(), 1);
$this->assertTrue($coll instanceof Doctrine_Collection);
$this->assertEqual($coll->count(), 8);
}
public function testResultSetCacheAddsResultSetsIntoCache2()
{
$q = new Doctrine_Query();
$cache = new Doctrine_Cache_Array();
$q->setOption('resultSetCache', $cache);
$q->select('u.name')->from('User u')->leftJoin('u.Phonenumber p');
$coll = $q->execute();
$this->assertEqual($cache->count(), 1);
$this->assertTrue($coll instanceof Doctrine_Collection);
$this->assertEqual($coll->count(), 8);
$coll = $q->execute();
$this->assertEqual($cache->count(), 1);
$this->assertTrue($coll instanceof Doctrine_Collection);
$this->assertEqual($coll->count(), 8);
}
}
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