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'); + } }