Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 33bcf7a

Browse files
Added coverage to DDC-1161.
1 parent 4474d30 commit 33bcf7a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,6 +1239,18 @@ public function testInheritanceTypeSingleTableInLeafClassWithEnabledForcePartial
12391239
array(Query::HINT_FORCE_PARTIAL_LOAD => true)
12401240
);
12411241
}
1242+
1243+
/**
1244+
* @group DDC-1161
1245+
*/
1246+
public function testSelfReferenceWithOneToOneDoesNotDuplicateAlias()
1247+
{
1248+
$this->assertSqlGeneration(
1249+
'SELECT p, pp FROM Doctrine\Tests\Models\Company\CompanyPerson p JOIN p.spouse pp',
1250+
"SELECT c0_.id AS id0, c0_.name AS name1, c1_.title AS title2, c1_.car_id AS car_id3, c2_.salary AS salary4, c2_.department AS department5, c2_.startDate AS startDate6, c3_.id AS id7, c3_.name AS name8, c4_.title AS title9, c4_.car_id AS car_id10, c5_.salary AS salary11, c5_.department AS department12, c5_.startDate AS startDate13, c0_.discr AS discr14, c0_.spouse_id AS spouse_id15, c3_.discr AS discr16, c3_.spouse_id AS spouse_id17 FROM company_persons c0_ LEFT JOIN company_managers c1_ ON c0_.id = c1_.id LEFT JOIN company_employees c2_ ON c0_.id = c2_.id INNER JOIN company_persons c3_ ON c0_.spouse_id = c3_.id LEFT JOIN company_managers c4_ ON c3_.id = c4_.id LEFT JOIN company_employees c5_ ON c3_.id = c5_.id",
1251+
array(Query::HINT_FORCE_PARTIAL_LOAD => false)
1252+
);
1253+
}
12421254
}
12431255

12441256

0 commit comments

Comments
 (0)