1
0
mirror of synced 2024-12-05 03:06:05 +03:00

Failing test case for broken paginator case

This commit is contained in:
Filip Procházka 2015-04-09 01:42:46 +02:00
parent 2c90930068
commit 192da14842
2 changed files with 39 additions and 1 deletions

View File

@ -350,5 +350,24 @@ ORDER BY b.id DESC'
$query->getSQL()
);
}
/**
* This tests ordering by property that has the 'declared' field.
*/
public function testLimitSubqueryOrderByFieldFromMappedSuperclass()
{
$this->entityManager->getConnection()->setDatabasePlatform(new MySqlPlatform());
// now use the third one in query
$query = $this->entityManager->createQuery(
'SELECT b FROM Doctrine\Tests\ORM\Tools\Pagination\Banner b ORDER BY b.id DESC'
);
$query->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Doctrine\ORM\Tools\Pagination\LimitSubqueryOutputWalker');
$this->assertEquals(
'SELECT DISTINCT id_0 FROM (SELECT b0_.id AS id_0, b0_.name AS name_1 FROM Banner b0_) dctrn_result ORDER BY id_0 DESC',
$query->getSQL()
);
}
}

View File

@ -169,3 +169,22 @@ class Avatar
/** @Column(type="string", length=255) */
public $image_alt_desc;
}
/** @MappedSuperclass */
abstract class Identified
{
/** @Id @Column(type="integer") @GeneratedValue */
private $id;
public function getId()
{
return $this->id;
}
}
/** @Entity */
class Banner extends Identified
{
/** @Column(type="string") */
public $name;
}