problem with LimitSubqueryOutputWalker when use InheritanceType
Conflicts: tests/Doctrine/Tests/OrmFunctionalTestCase.php
This commit is contained in:
parent
ff75a3ad49
commit
f92307d06d
4 changed files with 65 additions and 0 deletions
tests/Doctrine/Tests
27
tests/Doctrine/Tests/Models/Pagination/User.php
Normal file
27
tests/Doctrine/Tests/Models/Pagination/User.php
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Doctrine\Tests\Models\Pagination;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @package Doctrine\Tests\Models\Pagination
|
||||||
|
*
|
||||||
|
* @Entity
|
||||||
|
* @Table(name="pagination_user")
|
||||||
|
* @InheritanceType("SINGLE_TABLE")
|
||||||
|
* @DiscriminatorColumn(name="type", type="string")
|
||||||
|
* @DiscriminatorMap({"user1"="User1"})
|
||||||
|
*/
|
||||||
|
abstract class User
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @Id @Column(type="integer")
|
||||||
|
* @GeneratedValue
|
||||||
|
*/
|
||||||
|
private $id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Column(type="string")
|
||||||
|
*/
|
||||||
|
public $name;
|
||||||
|
}
|
17
tests/Doctrine/Tests/Models/Pagination/User1.php
Normal file
17
tests/Doctrine/Tests/Models/Pagination/User1.php
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Doctrine\Tests\Models\Pagination;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class User1
|
||||||
|
* @package Doctrine\Tests\Models\Pagination
|
||||||
|
*
|
||||||
|
* @Entity()
|
||||||
|
*/
|
||||||
|
class User1 extends User
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @Column(type="string")
|
||||||
|
*/
|
||||||
|
public $email;
|
||||||
|
}
|
|
@ -10,6 +10,7 @@ use Doctrine\ORM\Tools\Pagination\Paginator;
|
||||||
use Doctrine\Tests\Models\Pagination\Company;
|
use Doctrine\Tests\Models\Pagination\Company;
|
||||||
use Doctrine\Tests\Models\Pagination\Department;
|
use Doctrine\Tests\Models\Pagination\Department;
|
||||||
use Doctrine\Tests\Models\Pagination\Logo;
|
use Doctrine\Tests\Models\Pagination\Logo;
|
||||||
|
use Doctrine\Tests\Models\Pagination\User1;
|
||||||
use ReflectionMethod;
|
use ReflectionMethod;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -440,6 +441,16 @@ class PaginationTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||||
$this->iterateWithOrderDescWithLimitAndOffset(true, $fetchJoinCollection, $dql, "name");
|
$this->iterateWithOrderDescWithLimitAndOffset(true, $fetchJoinCollection, $dql, "name");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dataProvider fetchJoinCollection
|
||||||
|
*/
|
||||||
|
public function testIterateWithOutputWalkersWithFetchJoinWithComplexOrderByReferencingJoinedWithLimitAndOffsetWithInheritanceType($fetchJoinCollection)
|
||||||
|
{
|
||||||
|
$dql = 'SELECT u FROM Doctrine\Tests\Models\Pagination\User u ORDER BY u.id';
|
||||||
|
$this->iterateWithOrderAscWithLimit(true, $fetchJoinCollection, $dql, "name");
|
||||||
|
$this->iterateWithOrderDescWithLimit(true, $fetchJoinCollection, $dql, "name");
|
||||||
|
}
|
||||||
|
|
||||||
public function testIterateComplexWithOutputWalker()
|
public function testIterateComplexWithOutputWalker()
|
||||||
{
|
{
|
||||||
$dql = 'SELECT g, COUNT(u.id) AS userCount FROM Doctrine\Tests\Models\CMS\CmsGroup g LEFT JOIN g.users u GROUP BY g HAVING COUNT(u.id) > 0';
|
$dql = 'SELECT g, COUNT(u.id) AS userCount FROM Doctrine\Tests\Models\CMS\CmsGroup g LEFT JOIN g.users u GROUP BY g HAVING COUNT(u.id) > 0';
|
||||||
|
@ -663,6 +674,13 @@ class PaginationTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||||
$this->_em->persist($company);
|
$this->_em->persist($company);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for ($i = 0; $i < 9; $i++) {
|
||||||
|
$user = new User1();
|
||||||
|
$user->name = "name$i";
|
||||||
|
$user->email = "email$i";
|
||||||
|
$this->_em->persist($user);
|
||||||
|
}
|
||||||
|
|
||||||
$this->_em->flush();
|
$this->_em->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -271,6 +271,8 @@ abstract class OrmFunctionalTestCase extends OrmTestCase
|
||||||
'Doctrine\Tests\Models\Pagination\Company',
|
'Doctrine\Tests\Models\Pagination\Company',
|
||||||
'Doctrine\Tests\Models\Pagination\Logo',
|
'Doctrine\Tests\Models\Pagination\Logo',
|
||||||
'Doctrine\Tests\Models\Pagination\Department',
|
'Doctrine\Tests\Models\Pagination\Department',
|
||||||
|
'Doctrine\Tests\Models\Pagination\User',
|
||||||
|
'Doctrine\Tests\Models\Pagination\User1',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -524,6 +526,7 @@ abstract class OrmFunctionalTestCase extends OrmTestCase
|
||||||
$conn->executeUpdate('DELETE FROM pagination_logo');
|
$conn->executeUpdate('DELETE FROM pagination_logo');
|
||||||
$conn->executeUpdate('DELETE FROM pagination_department');
|
$conn->executeUpdate('DELETE FROM pagination_department');
|
||||||
$conn->executeUpdate('DELETE FROM pagination_company');
|
$conn->executeUpdate('DELETE FROM pagination_company');
|
||||||
|
$conn->executeUpdate('DELETE FROM pagination_user');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_em->clear();
|
$this->_em->clear();
|
||||||
|
|
Loading…
Add table
Reference in a new issue