@@ -66,7 +66,11 @@ public function testRedisConnect()
6666        $ this assertSame ('host ' , $ hostgetName ());
6767        $ this assertSame ('port ' , $ portgetName ());
6868        $ this assertSame ('timeout ' , $ timeoutgetName ());
69-         $ this assertSame ('retry_interval ' , $ retryIntervalgetName ());
69+         if  (version_compare (phpversion ('redis ' ), '6.0 ' , '>= ' )) {
70+             $ this assertSame ('persistent_id ' , $ retryIntervalgetName ());
71+         } else  {
72+             $ this assertSame ('retry_interval ' , $ retryIntervalgetName ());
73+         }
7074
7175        $ this assertTrue ($ redisconnect ('127.0.0.1 ' , 6379 , 0.0 , null , 0 , 0 ));
7276    }
@@ -159,14 +163,31 @@ public function testRedisClusterConstructor()
159163        $ refnew  ReflectionClass (RedisCluster::class);
160164        $ method$ refgetMethod ('__construct ' );
161165        $ names
162-             'name ' , 'seeds ' , 'timeout ' , 'read_timeout ' , 'persistent ' , 'auth ' ,
166+             ['name ' , 'string ' ],
167+             ['seeds ' , 'array ' ],
168+             ['timeout ' , ['int ' , 'float ' ]],
169+             ['read_timeout ' , ['int ' , 'float ' ]],
170+             ['persistent ' , 'bool ' ],
171+             ['auth ' , 'mixed ' ],
172+             ['context ' , 'array ' ],
163173        ];
164174        foreach  ($ methodgetParameters () as  $ parameter
165-             $ this assertSame (array_shift ($ names$ parametergetName ());
175+             [$ name$ typearray_shift ($ names
176+             $ this assertSame ($ name$ parametergetName ());
166177            if  ($ parametergetName () === 'seeds ' ) {
167178                $ this assertSame ('array ' , $ parametergetType ()->getName ());
168179            } else  {
169-                 $ this assertNull ($ parametergetType ());
180+                 if  (version_compare (phpversion ('redis ' ), '6.0 ' , '>= ' )) {
181+                     if  (is_array ($ type
182+                         foreach  ($ parametergetType ()->getTypes () as  $ namedType
183+                             $ this assertTrue (in_array ($ namedTypegetName (), $ type
184+                         }
185+                     } else  {
186+                         $ this assertSame ($ type$ parametergetType ()->getName ());
187+                     }
188+                 } else  {
189+                     $ this assertNull ($ parametergetType ());
190+                 }
170191            }
171192        }
172193    }
@@ -202,11 +223,16 @@ public function testRedisSentinelParams()
202223        $ relnew  ReflectionClass (RedisSentinel::class);
203224        $ method$ relgetMethod ('__construct ' );
204225        $ countcount ($ methodgetParameters ());
205-         if  ($ count6 ) {
206-             $ this markTestIncomplete ('RedisSentinel don \'t support auth. ' );
207-         }
208226
209-         $ this assertSame (7 , $ count
227+         if  (version_compare (phpversion ('redis ' ), '6.0 ' , '>= ' )) {
228+             $ this assertSame (1 , $ count
229+             $ this assertSame ('options ' , $ methodgetParameters ()[0 ]->getName ());
230+         } else  {
231+             if  ($ count6 ) {
232+                 $ this markTestIncomplete ('RedisSentinel don \'t support auth. ' );
233+             }
234+             $ this assertSame (7 , $ count
235+         }
210236    }
211237
212238    private  function  getRedis ()
0 commit comments