This commit is contained in:
parent
6673186970
commit
5cd993cdcc
1 changed files with 28 additions and 2 deletions
|
@ -51,9 +51,35 @@ class Doctrine_Query_Cache_TestCase extends Doctrine_UnitTestCase
|
||||||
$cache = new Doctrine_Cache_Array();
|
$cache = new Doctrine_Cache_Array();
|
||||||
$q->setOption('resultSetCache', $cache);
|
$q->setOption('resultSetCache', $cache);
|
||||||
$q->select('u.name')->from('User u');
|
$q->select('u.name')->from('User u');
|
||||||
|
$coll = $q->execute();
|
||||||
Doctrine::dump($q->getCachedForm());
|
|
||||||
|
|
||||||
$this->assertEqual($cache->count(), 1);
|
$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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue