for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Doctrine\Tests\ORM\Functional\Ticket;
use Doctrine\ORM\Annotation as ORM;
use Doctrine\Tests\OrmFunctionalTestCase;
final class GH7804 extends OrmFunctionalTestCase
{
protected function setUp(): void
parent::setUp();
$this->setUpEntitySchema([
GH7804Entity::class,
]);
}
public function testPositiveQuery(): void
$qb = $this->em->createQueryBuilder();
$qb->from(GH7804Entity::class, 'te1')
->select('te1.title as t')
->addGroupBy('t');
self::assertSQLEquals(
'select t0."title" as c0 from "te1" t0 group by t0."title"',
$qb->getQuery()->getSQL()
);
public function testIssue(): void
->select(
sprintf('new %s(te1.title as t)', GH7804Dto::class)
)
/**
* @ORM\Entity
* @ORM\Table(name="te1")
*/
class GH7804Entity
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
public $id;
/** @ORM\Column */
public $title;
* @param $title
public function __construct($title)
$this->title = $title;
final class GH7804Dto
private $title;
public function getTitle()
return $this->title;