Skip to content

Commit

Permalink
Merge pull request #9008 from greg0ire/2.10.x
Browse files Browse the repository at this point in the history
Merge 2.9.x up into 2.10.x
  • Loading branch information
derrabus authored Sep 13, 2021
2 parents 5c7e668 + dee58cf commit 31d8bd7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/Doctrine/Tests/ORM/Query/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use DateTime;
use DateTimeImmutable;
use Doctrine\Common\Cache\Cache;
use Doctrine\Common\Cache\Psr6\CacheAdapter;
use Doctrine\Common\Cache\Psr6\DoctrineProvider;
use Doctrine\Common\Collections\ArrayCollection;
Expand Down Expand Up @@ -550,4 +551,25 @@ public function testGetParameterColonNormalize(): void
self::assertSame('Benjamin', $query->getParameter(':name')->getValue());
self::assertSame('Benjamin', $query->getParameter('name')->getValue());
}

public function testGetQueryCacheDriverWithDefaults(): void
{
$cache = $this->createMock(Cache::class);

$this->entityManager->getConfiguration()->setQueryCacheImpl($cache);
$query = $this->entityManager->createQuery('select u from ' . CmsUser::class . ' u');

self::assertSame($cache, $query->getQueryCacheDriver());
}

public function testGetQueryCacheDriverWithCacheExplicitlySet(): void
{
$cache = $this->createMock(Cache::class);

$query = $this->entityManager
->createQuery('select u from ' . CmsUser::class . ' u')
->setQueryCacheDriver($cache);

self::assertSame($cache, $query->getQueryCacheDriver());
}
}

0 comments on commit 31d8bd7

Please sign in to comment.