Adding failing test case for PaginationTest
The failure comes into play when an entity has an attribute named differently from its corresponding column name.
This commit is contained in:
parent
608dfa2f57
commit
9d7aa9ba39
2 changed files with 19 additions and 0 deletions
|
@ -23,6 +23,11 @@ class Company
|
||||||
*/
|
*/
|
||||||
public $name;
|
public $name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Column(type="string", name="jurisdiction_code", nullable=true)
|
||||||
|
*/
|
||||||
|
public $jurisdiction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @OneToOne(targetEntity="Logo", mappedBy="company", cascade={"persist"}, orphanRemoval=true)
|
* @OneToOne(targetEntity="Logo", mappedBy="company", cascade={"persist"}, orphanRemoval=true)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -602,6 +602,20 @@ class PaginationTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||||
count($paginator);
|
count($paginator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test using a paginator when the entity attribute name and corresponding column name are not the same.
|
||||||
|
*/
|
||||||
|
public function testPaginationWithColumnAttributeNameDifference()
|
||||||
|
{
|
||||||
|
$dql = 'SELECT c FROM Doctrine\Tests\Models\Pagination\Company c ORDER BY c.id';
|
||||||
|
$query = $this->_em->createQuery($dql);
|
||||||
|
|
||||||
|
$paginator = new Paginator($query);
|
||||||
|
$paginator->getIterator();
|
||||||
|
|
||||||
|
$this->assertCount(9, $paginator->getIterator());
|
||||||
|
}
|
||||||
|
|
||||||
public function testCloneQuery()
|
public function testCloneQuery()
|
||||||
{
|
{
|
||||||
$dql = 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u';
|
$dql = 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u';
|
||||||
|
|
Loading…
Add table
Reference in a new issue