diff --git a/tests/Query/CacheTestCase.php b/tests/Query/CacheTestCase.php new file mode 100644 index 000000000..b4af52f3b --- /dev/null +++ b/tests/Query/CacheTestCase.php @@ -0,0 +1,59 @@ +. + */ + +/** + * 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); + } +}