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

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:
Kristopher Wilson 2015-03-31 13:35:47 -04:00 committed by Marco Pivetta
parent 608dfa2f57
commit 9d7aa9ba39
2 changed files with 19 additions and 0 deletions

View File

@ -23,6 +23,11 @@ class Company
*/
public $name;
/**
* @Column(type="string", name="jurisdiction_code", nullable=true)
*/
public $jurisdiction;
/**
* @OneToOne(targetEntity="Logo", mappedBy="company", cascade={"persist"}, orphanRemoval=true)
*/

View File

@ -602,6 +602,20 @@ class PaginationTest extends \Doctrine\Tests\OrmFunctionalTestCase
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()
{
$dql = 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u';