2012-04-05 12:30:00 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Doctrine\Tests\ORM\Functional\Ticket;
|
|
|
|
|
|
|
|
use Doctrine\ORM\UnitOfWork;
|
|
|
|
|
|
|
|
require_once __DIR__ . '/../../../TestInit.php';
|
|
|
|
|
|
|
|
class DDC1757Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
|
|
|
{
|
|
|
|
public function testFailingCase()
|
|
|
|
{
|
2012-05-04 21:16:07 +04:00
|
|
|
$qb = $this->_em->createQueryBuilder();
|
|
|
|
/* @var $qb \Doctrine\ORM\QueryBuilder */
|
2012-04-10 12:47:05 +04:00
|
|
|
|
2012-05-04 21:16:07 +04:00
|
|
|
$qb->select('_a')
|
|
|
|
->from(__NAMESPACE__ . '\DDC1757A', '_a')
|
|
|
|
->from(__NAMESPACE__ . '\DDC1757B', '_b')
|
|
|
|
->join('_b.c', '_c')
|
|
|
|
->join('_c.d', '_d');
|
2012-04-10 12:47:05 +04:00
|
|
|
|
|
|
|
$q = $qb->getQuery();
|
|
|
|
$dql = $q->getDQL();
|
|
|
|
|
2012-04-17 11:57:31 +04:00
|
|
|
// Show difference between expected and actual queries on error
|
|
|
|
self::assertEquals("SELECT _a FROM " . __NAMESPACE__ . "\DDC1757A _a, " . __NAMESPACE__ . "\DDC1757B _b INNER JOIN _b.c _c INNER JOIN _c.d _d",
|
|
|
|
$dql,
|
|
|
|
"Wrong DQL query");
|
2012-04-05 12:30:00 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Entity
|
|
|
|
*/
|
|
|
|
class DDC1757A
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @Column(type="integer")
|
|
|
|
* @Id
|
2012-05-04 21:16:07 +04:00
|
|
|
* @GeneratedValue(strategy="AUTO")
|
2012-04-05 12:30:00 +04:00
|
|
|
*/
|
|
|
|
private $id;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Entity
|
|
|
|
*/
|
|
|
|
class DDC1757B
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @Column(type="integer")
|
|
|
|
* @Id
|
2012-05-04 21:16:07 +04:00
|
|
|
* @GeneratedValue(strategy="AUTO")
|
2012-04-05 12:30:00 +04:00
|
|
|
*/
|
|
|
|
private $id;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @OneToOne(targetEntity="DDC1757C")
|
|
|
|
*/
|
|
|
|
private $c;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Entity
|
|
|
|
*/
|
|
|
|
class DDC1757C
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @Column(type="integer")
|
|
|
|
* @Id
|
|
|
|
* @GeneratedValue(strategy="AUTO")
|
|
|
|
*/
|
|
|
|
public $id;
|
|
|
|
|
2012-05-04 21:16:07 +04:00
|
|
|
/**
|
2012-04-05 12:30:00 +04:00
|
|
|
* @OneToOne(targetEntity="DDC1757D")
|
|
|
|
*/
|
|
|
|
private $d;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Entity
|
|
|
|
*/
|
|
|
|
class DDC1757D
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @Column(type="integer")
|
|
|
|
* @Id
|
|
|
|
* @GeneratedValue(strategy="AUTO")
|
|
|
|
*/
|
|
|
|
public $id;
|
|
|
|
}
|