1
0
mirror of synced 2025-01-31 20:41:44 +03:00

Verifying DDC-3042 - duplicate aliases in DQL SQL generation

This commit is contained in:
Marco Pivetta 2014-03-21 18:30:10 +01:00
parent 3680bb7ccc
commit 11b3065fd1

View File

@ -21,9 +21,14 @@ class DDC3042Test extends OrmFunctionalTestCase
public function testSQLGenerationDoesNotProvokeAliasCollisions()
{
$this->assertSame(
'..',
$this->_em->createQuery('SELECT f, b FROM Foo f JOIN Bar b')->getSQL()
$this->assertStringNotMatchesFormat(
'%sfield11%sfield11%s',
$this
->_em
->createQuery(
'SELECT f, b FROM ' . __NAMESPACE__ . '\DDC3042Foo f JOIN ' . __NAMESPACE__ . '\DDC3042Bar b WITH 1 = 1'
)
->getSQL()
);
}
}
@ -34,6 +39,8 @@ class DDC3042Test extends OrmFunctionalTestCase
class DDC3042Foo
{
/** @Id @Column(type="integer") @GeneratedValue */
public $field;
/** @Column(type="integer") */
public $field1;
/** @Column(type="integer") */
public $field2;
@ -61,5 +68,5 @@ class DDC3042Foo
class DDC3042Bar
{
/** @Id @Column(type="integer") @GeneratedValue */
public $field11;
public $field;
}