@@ -9,29 +9,27 @@ class KeepInCacheTest extends TestCase
9
9
{
10
10
protected $ sampleParams = ["x " , 1 ];
11
11
12
- public function testPreparedQueryWithParamsWithoutConfig ()
12
+ public function testIsNeedSetKeepQueryInCache ()
13
13
{
14
- self ::assertEquals (true , YdbQuery::isNeedSetKeepQueryInCache (null , $ this ->sampleParams ));
15
- }
16
-
17
- public function testPreparedQueryWithParamsWithConfig ()
18
- {
19
- self ::assertEquals (false , YdbQuery::isNeedSetKeepQueryInCache (false , $ this ->sampleParams ));
20
- }
21
-
22
- public function testPreparedQueryWithoutParamsWithoutConfig ()
23
- {
24
- self ::assertEquals (false , YdbQuery::isNeedSetKeepQueryInCache (null , null ));
25
- }
26
-
27
- public function testPreparedQueryWithoutParamsWithConfig ()
28
- {
29
- self ::assertEquals (false , YdbQuery::isNeedSetKeepQueryInCache (null , null ));
14
+ $ tests = [
15
+ ["flag " => null , "params " => null , "result " => false ],
16
+ ["flag " => null , "params " => [], "result " => false ],
17
+ ["flag " => null , "params " => $ this ->sampleParams , "result " => true ],
18
+ ["flag " => false , "params " => null , "result " => false ],
19
+ ["flag " => false , "params " => [], "result " => false ],
20
+ ["flag " => false , "params " => $ this ->sampleParams , "result " => false ],
21
+ ["flag " => true , "params " => null , "result " => true ],
22
+ ["flag " => true , "params " => [], "result " => true ],
23
+ ["flag " => true , "params " => $ this ->sampleParams , "result " => true ],
24
+ ];
25
+ foreach ($ tests as $ i => $ test ){
26
+ self ::assertEquals ($ test ["result " ], YdbQuery::isNeedSetKeepQueryInCache ($ test ["flag " ], $ test ["params " ]));
27
+ }
30
28
}
31
29
}
32
30
class YdbQuery extends \YdbPlatform \Ydb \YdbQuery{
33
- public static function isNeedSetKeepQueryInCache (?bool $ currentParams , ?array $ queryDeclaredParams ): bool
31
+ public static function isNeedSetKeepQueryInCache (?bool $ userFlag , ?array $ queryDeclaredParams ): bool
34
32
{
35
- return parent ::isNeedSetKeepQueryInCache ($ currentParams , $ queryDeclaredParams );
33
+ return parent ::isNeedSetKeepQueryInCache ($ userFlag , $ queryDeclaredParams );
36
34
}
37
35
}
0 commit comments