44
55namespace RunOpenCode \Bundle \QueryResourcesLoader \Tests \Cache ;
66
7+ use Doctrine \DBAL \Driver \Result ;
78use RunOpenCode \Bundle \QueryResourcesLoader \Cache \CacheIdentity ;
89use RunOpenCode \Bundle \QueryResourcesLoader \Contract \QueryResourcesLoaderInterface ;
910use RunOpenCode \Bundle \QueryResourcesLoader \Model \Options ;
@@ -15,8 +16,10 @@ public function testCacheIntegration(): void
1516 {
1617 $ this ->createFixtures ();
1718
19+ /** @var QueryResourcesLoaderInterface $loader */
1820 $ loader = $ this ->getContainer ()->get (QueryResourcesLoaderInterface::class);
19- $ data = $ loader ->execute ('SELECT id, title FROM bar ORDER BY id ' , null , Options::cached (new CacheIdentity (
21+ /** @var Result $resultSet */
22+ $ resultSet = $ loader ->execute ('SELECT id, title FROM bar ORDER BY id ' , null , Options::cached (new CacheIdentity (
2023 'foo ' ,
2124 )));
2225
@@ -26,13 +29,15 @@ public function testCacheIntegration(): void
2629 ['id ' => 3 , 'title ' => 'Bar title 3 ' ],
2730 ['id ' => 4 , 'title ' => 'Bar title 4 ' ],
2831 ['id ' => 5 , 'title ' => 'Bar title 5 ' ],
29- ], $ data ->fetchAllAssociative ());
30-
32+ ], $ resultSet ->fetchAllAssociative ());
33+
3134 $ this ->ensureKernelShutdown ();
3235 $ this ->bootKernel ();
33-
36+
37+ /** @var QueryResourcesLoaderInterface $loader */
3438 $ loader = $ this ->getContainer ()->get (QueryResourcesLoaderInterface::class);
35- $ data = $ loader ->execute ('SELECT * FROM bar ' , null , Options::cached (new CacheIdentity (
39+ /** @var Result $resultSet */
40+ $ resultSet = $ loader ->execute ('SELECT * FROM bar ' , null , Options::cached (new CacheIdentity (
3641 'foo ' ,
3742 )));
3843
@@ -42,6 +47,6 @@ public function testCacheIntegration(): void
4247 ['id ' => 3 , 'title ' => 'Bar title 3 ' ],
4348 ['id ' => 4 , 'title ' => 'Bar title 4 ' ],
4449 ['id ' => 5 , 'title ' => 'Bar title 5 ' ],
45- ], $ data ->fetchAllAssociative ());
50+ ], $ resultSet ->fetchAllAssociative ());
4651 }
4752}
0 commit comments