File tree 1 file changed +22
-0
lines changed
tests/Doctrine/Tests/ORM/Query
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 6
6
7
7
use DateTime ;
8
8
use DateTimeImmutable ;
9
+ use Doctrine \Common \Cache \Cache ;
9
10
use Doctrine \Common \Cache \Psr6 \DoctrineProvider ;
10
11
use Doctrine \Common \Collections \ArrayCollection ;
11
12
use Doctrine \DBAL \Types \Type ;
@@ -533,4 +534,25 @@ public function testGetParameterColonNormalize(): void
533
534
self ::assertSame ('Benjamin ' , $ query ->getParameter (':name ' )->getValue ());
534
535
self ::assertSame ('Benjamin ' , $ query ->getParameter ('name ' )->getValue ());
535
536
}
537
+
538
+ public function testGetQueryCacheDriverWithDefaults ()
539
+ {
540
+ $ cache = $ this ->createMock (Cache::class);
541
+
542
+ $ this ->entityManager ->getConfiguration ()->setQueryCacheImpl ($ cache );
543
+ $ query = $ this ->entityManager ->createQuery ('select u from ' . CmsUser::class . ' u ' );
544
+
545
+ self ::assertSame ($ cache , $ query ->getQueryCacheDriver ());
546
+ }
547
+
548
+ public function testGetQueryCacheDriverWithCacheExplicitlySet ()
549
+ {
550
+ $ cache = $ this ->createMock (Cache::class);
551
+
552
+ $ query = $ this ->entityManager
553
+ ->createQuery ('select u from ' . CmsUser::class . ' u ' )
554
+ ->setQueryCacheDriver ($ cache );
555
+
556
+ self ::assertSame ($ cache , $ query ->getQueryCacheDriver ());
557
+ }
536
558
}
You can’t perform that action at this time.
0 commit comments