$this->assertEquals('SELECT u.* FROM users u WHERE u.name = ?',(string)$qb);
$this->assertEquals('SELECT u.* FROM `users` u WHERE u.name = ?',(string)$qb);
$this->assertEquals(10,$qb->getParameter(1));
}
...
...
@@ -582,7 +591,7 @@ class QueryBuilderTest extends \Doctrine\Tests\DbalTestCase
->where('nt.lang = ?')
->andWhere('n.deleted = 0');
$this->assertEquals("SELECT COUNT(DISTINCT news.id) FROM newspages news INNER JOIN nodeversion nv ON nv.refId = news.id AND nv.refEntityname='Entity\\News' INNER JOIN nodetranslation nt ON nv.nodetranslation = nt.id INNER JOIN node n ON nt.node = n.id WHERE (nt.lang = ?) AND (n.deleted = 0)",$qb->getSQL());
$this->assertEquals("SELECT COUNT(DISTINCT news.id) FROM `newspages` news INNER JOIN `nodeversion` nv ON nv.refId = news.id AND nv.refEntityname='Entity\\News' INNER JOIN `nodetranslation` nt ON nv.nodetranslation = nt.id INNER JOIN `node` n ON nt.node = n.id WHERE (nt.lang = ?) AND (n.deleted = 0)",$qb->getSQL());
}
/**
...
...
@@ -600,6 +609,6 @@ class QueryBuilderTest extends \Doctrine\Tests\DbalTestCase
->where('u.id = a.user_id')
->andWhere('p.read = 1');
$this->assertEquals('SELECT DISTINCT u.id FROM users u INNER JOIN permissions p ON p.user_id = u.id, articles a INNER JOIN comments c ON c.article_id = a.id WHERE (u.id = a.user_id) AND (p.read = 1)',$qb->getSQL());
$this->assertEquals('SELECT DISTINCT u.id FROM `users` u INNER JOIN `permissions` p ON p.user_id = u.id, `articles` a INNER JOIN `comments` c ON c.article_id = a.id WHERE (u.id = a.user_id) AND (p.read = 1)',$qb->getSQL());