Update DDC719Test.php to be compatible with MsSQL
Apparently Doctrine adds "with (nolock)" now for the mssql platform, but the test has not been updated yet.
This commit is contained in:
parent
c72698a997
commit
a190dad0b1
@ -19,8 +19,14 @@ class DDC719Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
{
|
||||
$q = $this->_em->createQuery('SELECT g, c FROM Doctrine\Tests\ORM\Functional\Ticket\DDC719Group g LEFT JOIN g.children c WHERE g.parents IS EMPTY');
|
||||
|
||||
if ($this->_em->getConnection()->getDatabasePlatform()->getName() === 'mssql') {
|
||||
$referenceSQL = 'SELECT g0_.name AS name0, g0_.description AS description1, g0_.id AS id2, g1_.name AS name3, g1_.description AS description4, g1_.id AS id5 FROM groups g0_ with (nolock) LEFT JOIN groups_groups g2_ ON g0_.id = g2_.parent_id LEFT JOIN groups g1_ ON g1_.id = g2_.child_id WHERE (SELECT COUNT(*) FROM groups_groups g3_ WHERE g3_.child_id = g0_.id) = 0';
|
||||
} else {
|
||||
$referenceSQL = 'SELECT g0_.name AS name0, g0_.description AS description1, g0_.id AS id2, g1_.name AS name3, g1_.description AS description4, g1_.id AS id5 FROM groups g0_ LEFT JOIN groups_groups g2_ ON g0_.id = g2_.parent_id LEFT JOIN groups g1_ ON g1_.id = g2_.child_id WHERE (SELECT COUNT(*) FROM groups_groups g3_ WHERE g3_.child_id = g0_.id) = 0';
|
||||
}
|
||||
|
||||
$this->assertEquals(
|
||||
strtolower('SELECT g0_.name AS name0, g0_.description AS description1, g0_.id AS id2, g1_.name AS name3, g1_.description AS description4, g1_.id AS id5 FROM groups g0_ LEFT JOIN groups_groups g2_ ON g0_.id = g2_.parent_id LEFT JOIN groups g1_ ON g1_.id = g2_.child_id WHERE (SELECT COUNT(*) FROM groups_groups g3_ WHERE g3_.child_id = g0_.id) = 0'),
|
||||
strtolower($referenceSQL),
|
||||
strtolower($q->getSQL())
|
||||
);
|
||||
}
|
||||
@ -109,4 +115,4 @@ class DDC719Group extends Entity {
|
||||
public function getChildren() { return $this->children; }
|
||||
public function getParents() { return $this->parents; }
|
||||
public function getChannels() { return $this->channels; }
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user