Skip to content

Commit

Permalink
Fixed codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
florentdestremau committed Mar 5, 2024
1 parent 5704615 commit a6e2fa2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/Query/Postgresql/DateTruncTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace DoctrineExtensions\Tests\Query\Postgresql;

use DateTime;
use Doctrine\ORM\QueryBuilder;
use DoctrineExtensions\Tests\Entities\Date;
use DoctrineExtensions\Tests\Query\PostgresqlTestCase;
Expand All @@ -20,16 +21,15 @@ public function testDateTrunc(): void
$this->assertEquals($expected, $queryBuilder->getQuery()->getSQL());
}

public function testDateTruncCondition()
public function testDateTruncCondition(): void
{
$queryBuilder = $this->entityManager->getRepository(Date::class)
->createQueryBuilder('dt')
->where("date_trunc('YEAR', dt.created) = date_trunc('YEAR', :date)")
->setParameter('date', new \DateTime('2010-01-01'));
->setParameter('date', new DateTime('2010-01-01'));

$expected = "SELECT d0_.id AS id_0, d0_.created AS created_1 FROM Date d0_ WHERE DATE_TRUNC('YEAR'::text, d0_.created::timestamp) = DATE_TRUNC('YEAR'::text, ?::timestamp)";

$this->assertEquals($expected, $queryBuilder->getQuery()->getSQL());

}
}

0 comments on commit a6e2fa2

Please sign in to comment.