. */ /** * Doctrine_Query_Registry_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_Registry_TestCase extends Doctrine_UnitTestCase { public function prepareTables() { $this->tables = array('User'); parent::prepareTables(); } public function prepareData() { } public function testAddingQueries() { $registry = new Doctrine_Query_Registry(); $registry->add('all-users', 'SELECT u.* FROM User u'); $this->assertEqual($registry->get('all-users')->getDql(), 'SELECT u.* FROM User u'); } public function testAddingQueriesWithNamespaces() { $registry = new Doctrine_Query_Registry(); $registry->add('User/all', 'SELECT u.* FROM User u'); $this->assertEqual($registry->get('all', 'User')->getDql(), 'SELECT u.* FROM User u'); $this->manager->setQueryRegistry($registry); $user = new User(); $user->getTable()->execute('all'); } }