Skip to content

Commit

Permalink
Skip test because Doctrine < 2.2 doesnt support alias in HAVING
Browse files Browse the repository at this point in the history
  • Loading branch information
eigan authored and stevelacey committed Dec 1, 2017
1 parent 413224c commit a7957e5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/Query/Mysql/DateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace DoctrineExtensions\Tests\Query\Mysql;

use Doctrine\ORM\Version;

class DateTest extends \DoctrineExtensions\Tests\Query\MysqlTestCase
{
public function testDateDiff()
Expand All @@ -24,6 +26,10 @@ public function testDateAdd()

public function testDateAddWithColumnAlias()
{
if(Version::VERSION < 2.2) {
$this->markTestSkipped('Alias is not supported in Doctrine 2.1 and lower');
}

$dql = "SELECT p.created as alternative FROM DoctrineExtensions\Tests\Entities\Date p HAVING DATEADD(alternative, 4, 'MONTH') < 7";
$q = $this->entityManager->createQuery($dql);
$sql = "SELECT d0_.created AS created_0 FROM Date d0_ HAVING DATE_ADD(created_0, INTERVAL 4 MONTH) < 7";
Expand Down

0 comments on commit a7957e5

Please sign in to comment.