1
0
mirror of synced 2024-12-13 14:56:01 +03:00
This commit is contained in:
zYne 2007-09-17 21:38:16 +00:00
parent 78f8aea897
commit 9ac324d735

View File

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