4
4
5
5
namespace RunOpenCode \Bundle \QueryResourcesLoader \Tests \Cache ;
6
6
7
+ use Doctrine \DBAL \Driver \Result ;
7
8
use RunOpenCode \Bundle \QueryResourcesLoader \Cache \CacheIdentity ;
8
9
use RunOpenCode \Bundle \QueryResourcesLoader \Contract \QueryResourcesLoaderInterface ;
9
10
use RunOpenCode \Bundle \QueryResourcesLoader \Model \Options ;
@@ -15,8 +16,10 @@ public function testCacheIntegration(): void
15
16
{
16
17
$ this ->createFixtures ();
17
18
19
+ /** @var QueryResourcesLoaderInterface $loader */
18
20
$ 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 (
20
23
'foo ' ,
21
24
)));
22
25
@@ -26,13 +29,15 @@ public function testCacheIntegration(): void
26
29
['id ' => 3 , 'title ' => 'Bar title 3 ' ],
27
30
['id ' => 4 , 'title ' => 'Bar title 4 ' ],
28
31
['id ' => 5 , 'title ' => 'Bar title 5 ' ],
29
- ], $ data ->fetchAllAssociative ());
30
-
32
+ ], $ resultSet ->fetchAllAssociative ());
33
+
31
34
$ this ->ensureKernelShutdown ();
32
35
$ this ->bootKernel ();
33
-
36
+
37
+ /** @var QueryResourcesLoaderInterface $loader */
34
38
$ 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 (
36
41
'foo ' ,
37
42
)));
38
43
@@ -42,6 +47,6 @@ public function testCacheIntegration(): void
42
47
['id ' => 3 , 'title ' => 'Bar title 3 ' ],
43
48
['id ' => 4 , 'title ' => 'Bar title 4 ' ],
44
49
['id ' => 5 , 'title ' => 'Bar title 5 ' ],
45
- ], $ data ->fetchAllAssociative ());
50
+ ], $ resultSet ->fetchAllAssociative ());
46
51
}
47
52
}
0 commit comments