DoctrineExtensions\Tests\Query\Postgresql\AtTimeZoneTest::testAtTimeZone PHP Method

testAtTimeZone() public method

public testAtTimeZone ( )
    public function testAtTimeZone()
    {
        $dql = "SELECT d FROM DoctrineExtensions\\Tests\\Entities\\Date d WHERE AT_TIME_ZONE(d.created, :timeZone) < :currentTime";
        $q = $this->entityManager->createQuery($dql);
        $q->setParameter('timeZone', 'UTC');
        $q->setParameter('currentTime', date('Y-m-d H:i:s'));
        $sql = 'SELECT d0_.id AS id_0, d0_.created AS created_1 FROM Date d0_ WHERE d0_.created AT TIME ZONE ? < ?';
        $this->assertEquals($sql, $q->getSql());
    }
AtTimeZoneTest