Commit 4346c9f8 authored by zYne's avatar zYne

--no commit message

--no commit message
parent e40a541b
......@@ -42,7 +42,7 @@ class Doctrine_Query_Limit_TestCase extends Doctrine_UnitTestCase
parent::prepareTables();
}
/**
public function testLimitWithOneToOneLeftJoin()
{
$q = new Doctrine_Query();
......@@ -62,6 +62,7 @@ class Doctrine_Query_Limit_TestCase extends Doctrine_UnitTestCase
$this->assertEqual($users->count(), 5);
$this->assertEqual($q->getQuery(), "SELECT e.id AS e__id, e2.id AS e2__id, e2.address AS e2__address FROM entity e INNER JOIN email e2 ON e.email_id = e2.id WHERE (e.type = 0) LIMIT 5");
}
*/
public function testLimitWithOneToManyLeftJoin()
{
$q = new Doctrine_Query();
......
......@@ -92,6 +92,7 @@ class Doctrine_Query_Subquery_TestCase extends Doctrine_UnitTestCase
$query->from('User u, u.Album a');
$query->orderby('num_albums');
try{
// this causes getLimitSubquery() to be used, and it fails
$query->limit(5);
......
......@@ -33,6 +33,7 @@
*/
class Doctrine_Query_Update_TestCase extends Doctrine_UnitTestCase
{
public function testUpdateAllWithColumnAggregationInheritance()
{
$q = new Doctrine_Query();
......@@ -47,6 +48,7 @@ class Doctrine_Query_Update_TestCase extends Doctrine_UnitTestCase
$this->assertEqual($q->getQuery(), "UPDATE entity SET name = 'someone' WHERE (type = 0)");
}
public function testUpdateWorksWithMultipleColumns()
{
$q = new Doctrine_Query();
......@@ -61,6 +63,7 @@ class Doctrine_Query_Update_TestCase extends Doctrine_UnitTestCase
$this->assertEqual($q->getQuery(), "UPDATE entity SET name = 'someone', email_id = 5 WHERE (type = 0)");
}
public function testUpdateSupportsConditions()
{
$q = new Doctrine_Query();
......
......@@ -35,7 +35,7 @@ class Doctrine_Query_Where_TestCase extends Doctrine_UnitTestCase
{
public function prepareData() { }
public function prepareTables() {
$this->tables = array('Entity', 'EnumTest');
$this->tables = array('Entity', 'EnumTest', 'GroupUser');
parent::prepareTables();
}
......@@ -237,6 +237,8 @@ class Doctrine_Query_Where_TestCase extends Doctrine_UnitTestCase
$q->select('e.*')->from('EnumTest e')->where('e.status = ?');
$q->getQuery();
$this->assertEqual(count($q->getEnumParams()), 1);
$q->execute(array('verified'));
......@@ -246,6 +248,9 @@ class Doctrine_Query_Where_TestCase extends Doctrine_UnitTestCase
$q = new Doctrine_Query();
$q->select('e.*')->from('EnumTest e')->where('e.id = ? AND e.status = ?');
$q->getQuery();
$p = $q->getEnumParams();
$this->assertEqual(array_keys($p), array(0, 1));
$this->assertTrue(empty($p[0]));
......@@ -256,6 +261,9 @@ class Doctrine_Query_Where_TestCase extends Doctrine_UnitTestCase
$q = new Doctrine_Query();
$q->select('e.*')->from('EnumTest e')->where('e.id = :id AND e.status = :status');
$q->getQuery();
$p = $q->getEnumParams();
$this->assertEqual(array_keys($p), array(':id', ':status'));
$this->assertTrue(empty($p[':id']));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment