adding a failing test case for ticket #307
This commit is contained in:
parent
d82f539d8d
commit
eed2a37037
@ -53,5 +53,16 @@ class Doctrine_Query_Subquery_TestCase extends Doctrine_UnitTestCase
|
|||||||
|
|
||||||
$this->assertEqual($q->getQuery(), "SELECT e.id AS e__id, e.name AS e__name, e.loginname AS e__loginname, e.password AS e__password, e.type AS e__type, e.created AS e__created, e.updated AS e__updated, e.email_id AS e__email_id FROM entity e WHERE e.id NOT IN (SELECT g.user_id AS g__user_id FROM groupuser g) AND (e.type = 0)");
|
$this->assertEqual($q->getQuery(), "SELECT e.id AS e__id, e.name AS e__name, e.loginname AS e__loginname, e.password AS e__password, e.type AS e__type, e.created AS e__created, e.updated AS e__updated, e.email_id AS e__email_id FROM entity e WHERE e.id NOT IN (SELECT g.user_id AS g__user_id FROM groupuser g) AND (e.type = 0)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSubqueryInSelectPart()
|
||||||
|
{
|
||||||
|
// ticket #307
|
||||||
|
$q = new Doctrine_Query();
|
||||||
|
$q->query("SELECT u.*, (SELECT p.name FROM User p WHERE p.name = u.name) name2 FROM User u WHERE u.name = 'zYne' LIMIT 1");
|
||||||
|
|
||||||
|
$users = $q->execute();
|
||||||
|
|
||||||
|
$this->assertEqual($users->count(), 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user