. */ /** * Doctrine_Query_Cache_TestCase * * @package Doctrine * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping * @link www.phpdoctrine.com * @since 1.0 * @version $Revision$ */ class Doctrine_Query_Cache_TestCase extends Doctrine_UnitTestCase { public function testParserCacheAddsQueriesToCache() { $q = new Doctrine_Query(); $cache = new Doctrine_Cache_Array(); $q->setOption('parserCache', $cache); $q->select('u.name')->from('User u'); $q->getQuery(); $this->assertEqual($cache->count(), 1); } public function testResultSetCacheAddsResultSetsIntoCache() { $q = new Doctrine_Query(); $cache = new Doctrine_Cache_Array(); $q->setOption('resultSetCache', $cache); $q->select('u.name')->from('User u'); Doctrine::dump($q->getCachedForm()); $this->assertEqual($cache->count(), 1); } }