$this->assertValidDql('SELECT u.* FROM CmsUser u WHERE EXISTS (SELECT p.user_id FROM CmsPhonenumber p WHERE p.user_id = u.id)');
$this->assertValidDql('SELECT u.* FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE EXISTS (SELECT p.user_id FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p WHERE p.user_id = u.id)');
$this->assertValidDql('SELECT u.* FROM CmsUser u WHERE NOT EXISTS (SELECT p.user_id FROM CmsPhonenumber p WHERE p.user_id = u.id)');
$this->assertValidDql('SELECT u.* FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE NOT EXISTS (SELECT p.user_id FROM Doctrine\Tests\Models\CMS\CmsPhonenumber p WHERE p.user_id = u.id)');
$this->assertValidDql("SELECT u.name FROM CmsUser u LEFT JOIN u.phonenumbers p HAVING MAX(u.name) = 'zYne'");
$this->assertValidDql("SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.phonenumbers p HAVING MAX(u.name) = 'zYne'");
}
}
publicfunctiontestLeftJoin()
publicfunctiontestLeftJoin()
{
{
$this->assertValidDql('SELECT u.*, p.* FROM CmsUser u LEFT JOIN u.phonenumbers p');
$this->assertValidDql('SELECT u.*, p.* FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.phonenumbers p');
}
}
publicfunctiontestJoin()
publicfunctiontestJoin()
{
{
$this->assertValidDql('SELECT u.* FROM CmsUser u JOIN u.phonenumbers');
$this->assertValidDql('SELECT u.* FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN u.phonenumbers');
}
}
publicfunctiontestInnerJoin()
publicfunctiontestInnerJoin()
{
{
$this->assertValidDql('SELECT u.*, u.phonenumbers.* FROM CmsUser u INNER JOIN u.phonenumbers');
$this->assertValidDql('SELECT u.*, u.phonenumbers.* FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.phonenumbers');
}
}
publicfunctiontestMultipleLeftJoin()
publicfunctiontestMultipleLeftJoin()
{
{
$this->assertValidDql('SELECT u.articles.*, u.phonenumbers.* FROM CmsUser u LEFT JOIN u.articles LEFT JOIN u.phonenumbers');
$this->assertValidDql('SELECT u.articles.*, u.phonenumbers.* FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.articles LEFT JOIN u.phonenumbers');
}
}
publicfunctiontestMultipleInnerJoin()
publicfunctiontestMultipleInnerJoin()
{
{
$this->assertValidDql('SELECT u.name FROM CmsUser u INNER JOIN u.articles INNER JOIN u.phonenumbers');
$this->assertValidDql('SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.articles INNER JOIN u.phonenumbers');
}
}
publicfunctiontestMultipleInnerJoin2()
publicfunctiontestMultipleInnerJoin2()
{
{
$this->assertValidDql('SELECT u.name FROM CmsUser u INNER JOIN u.articles, u.phonenumbers');
$this->assertValidDql('SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.articles, u.phonenumbers');
}
}
publicfunctiontestMixingOfJoins()
publicfunctiontestMixingOfJoins()
{
{
$this->assertValidDql('SELECT u.name, a.topic, p.phonenumber FROM CmsUser u INNER JOIN u.articles a LEFT JOIN u.phonenumbers p');
$this->assertValidDql('SELECT u.name, a.topic, p.phonenumber FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.articles a LEFT JOIN u.phonenumbers p');
}
}
publicfunctiontestMixingOfJoins2()
publicfunctiontestMixingOfJoins2()
{
{
$this->assertInvalidDql('SELECT u.name, u.articles.topic, c.text FROM CmsUser u INNER JOIN u.articles.comments c');
$this->assertInvalidDql('SELECT u.name, u.articles.topic, c.text FROM Doctrine\Tests\Models\CMS\CmsUser u INNER JOIN u.articles.comments c');
}
}
publicfunctiontestOrderBySingleColumn()
publicfunctiontestOrderBySingleColumn()
{
{
$this->assertValidDql('SELECT u.name FROM CmsUser u ORDER BY u.name');
$this->assertValidDql('SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u ORDER BY u.name');
}
}
publicfunctiontestOrderBySingleColumnAscending()
publicfunctiontestOrderBySingleColumnAscending()
{
{
$this->assertValidDql('SELECT u.name FROM CmsUser u ORDER BY u.name ASC');
$this->assertValidDql('SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u ORDER BY u.name ASC');
}
}
publicfunctiontestOrderBySingleColumnDescending()
publicfunctiontestOrderBySingleColumnDescending()
{
{
$this->assertValidDql('SELECT u.name FROM CmsUser u ORDER BY u.name DESC');
$this->assertValidDql('SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u ORDER BY u.name DESC');
}
}
publicfunctiontestOrderByMultipleColumns()
publicfunctiontestOrderByMultipleColumns()
{
{
$this->assertValidDql('SELECT u.name, u.username FROM CmsUser u ORDER BY u.username DESC, u.name DESC');
$this->assertValidDql('SELECT u.name, u.username FROM Doctrine\Tests\Models\CMS\CmsUser u ORDER BY u.username DESC, u.name DESC');
}
}
publicfunctiontestOrderByWithFunctionExpression()
publicfunctiontestOrderByWithFunctionExpression()
{
{
$this->assertValidDql('SELECT u.name FROM CmsUser u ORDER BY COALESCE(u.id, u.name) DESC');
$this->assertValidDql('SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u ORDER BY COALESCE(u.id, u.name) DESC');
}
}
/*
/*
public function testSubselectInInExpression()
public function testSubselectInInExpression()
...
@@ -315,12 +276,12 @@ class Orm_Query_LanguageRecognitionTest extends Doctrine_OrmTestCase
...
@@ -315,12 +276,12 @@ class Orm_Query_LanguageRecognitionTest extends Doctrine_OrmTestCase
*/
*/
publicfunctiontestPositionalInputParameter()
publicfunctiontestPositionalInputParameter()
{
{
$this->assertValidDql('SELECT * FROM CmsUser u WHERE u.id = ?');
$this->assertValidDql('SELECT * FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = ?');
}
}
publicfunctiontestNamedInputParameter()
publicfunctiontestNamedInputParameter()
{
{
$this->assertValidDql('SELECT * FROM CmsUser u WHERE u.id = :id');
$this->assertValidDql('SELECT * FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :id');
}
}
/*
/*
public function testCustomJoinsAndWithKeywordSupported()
public function testCustomJoinsAndWithKeywordSupported()
...
@@ -332,32 +293,32 @@ class Orm_Query_LanguageRecognitionTest extends Doctrine_OrmTestCase
...
@@ -332,32 +293,32 @@ class Orm_Query_LanguageRecognitionTest extends Doctrine_OrmTestCase
publicfunctiontestJoinConditionsSupported()
publicfunctiontestJoinConditionsSupported()
{
{
$this->assertValidDql("SELECT u.name, p.* FROM CmsUser u LEFT JOIN u.phonenumbers p ON p.phonenumber = '123 123'");
$this->assertValidDql("SELECT u.name, p.* FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.phonenumbers p ON p.phonenumber = '123 123'");
}
}
publicfunctiontestIndexByClauseWithOneComponent()
publicfunctiontestIndexByClauseWithOneComponent()
{
{
$this->assertValidDql('SELECT * FROM CmsUser u INDEX BY id');
$this->assertValidDql('SELECT * FROM Doctrine\Tests\Models\CMS\CmsUser u INDEX BY id');
}
}
publicfunctiontestIndexBySupportsJoins()
publicfunctiontestIndexBySupportsJoins()
{
{
$this->assertValidDql('SELECT u.*, u.articles.* FROM CmsUser u LEFT JOIN u.articles INDEX BY id');// INDEX BY is now referring to articles
$this->assertValidDql('SELECT u.*, u.articles.* FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.articles INDEX BY id');// INDEX BY is now referring to articles
}
}
publicfunctiontestIndexBySupportsJoins2()
publicfunctiontestIndexBySupportsJoins2()
{
{
$this->assertValidDql('SELECT u.*, p.* FROM CmsUser u INDEX BY id LEFT JOIN u.phonenumbers p INDEX BY phonenumber');
$this->assertValidDql('SELECT u.*, p.* FROM Doctrine\Tests\Models\CMS\CmsUser u INDEX BY id LEFT JOIN u.phonenumbers p INDEX BY phonenumber');
}
}
publicfunctiontestBetweenExpressionSupported()
publicfunctiontestBetweenExpressionSupported()
{
{
$this->assertValidDql("SELECT * FROM CmsUser u WHERE u.name BETWEEN 'jepso' AND 'zYne'");
$this->assertValidDql("SELECT * FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name BETWEEN 'jepso' AND 'zYne'");
}
}
publicfunctiontestNotBetweenExpressionSupported()
publicfunctiontestNotBetweenExpressionSupported()
{
{
$this->assertValidDql("SELECT * FROM CmsUser u WHERE u.name NOT BETWEEN 'jepso' AND 'zYne'");
$this->assertValidDql("SELECT * FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name NOT BETWEEN 'jepso' AND 'zYne'");
}
}
/* public function testAllExpressionWithCorrelatedSubquery()
/* public function testAllExpressionWithCorrelatedSubquery()
...
@@ -380,17 +341,17 @@ class Orm_Query_LanguageRecognitionTest extends Doctrine_OrmTestCase
...
@@ -380,17 +341,17 @@ class Orm_Query_LanguageRecognitionTest extends Doctrine_OrmTestCase
*/
*/
publicfunctiontestLikeExpression()
publicfunctiontestLikeExpression()
{
{
$this->assertValidDql("SELECT u.id FROM CmsUser u WHERE u.name LIKE 'z%'");
$this->assertValidDql("SELECT u.id FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name LIKE 'z%'");
}
}
publicfunctiontestNotLikeExpression()
publicfunctiontestNotLikeExpression()
{
{
$this->assertValidDql("SELECT u.id FROM CmsUser u WHERE u.name NOT LIKE 'z%'");
$this->assertValidDql("SELECT u.id FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name NOT LIKE 'z%'");