From 9ac324d735610dadd0bd990f3f29353ba1274b56 Mon Sep 17 00:00:00 2001 From: zYne <zYne@625475ce-881a-0410-a577-b389adb331d8> Date: Mon, 17 Sep 2007 21:38:16 +0000 Subject: [PATCH] --- tests/Query/RegistryTestCase.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/Query/RegistryTestCase.php b/tests/Query/RegistryTestCase.php index 97ca97a8a..cead5ed77 100644 --- a/tests/Query/RegistryTestCase.php +++ b/tests/Query/RegistryTestCase.php @@ -30,8 +30,14 @@ * @since 1.0 * @version $Revision$ */ -class Doctrine_Query_Registry_TestCase +class Doctrine_Query_Registry_TestCase extends Doctrine_UnitTestCase { + public function prepareTables() + { + $this->tables = array('User'); + } + public function prepareData() + { } public function testAddingQueries() { $registry = new Doctrine_Query_Registry(); @@ -40,4 +46,16 @@ class Doctrine_Query_Registry_TestCase $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'); + + $user = new User(); + + $user->fetch('all'); + } }