This commit is contained in:
parent
78f8aea897
commit
9ac324d735
@ -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');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user