@@ -40,7 +40,9 @@ public function setUp(): void
4040 $ this ->redis = new RedisClient ('localhost ' );
4141
4242 $ ref = new \ReflectionProperty ($ this ->redis , 'factory ' );
43- $ ref ->setAccessible (true );
43+ if (PHP_VERSION_ID < 80100 ) {
44+ $ ref ->setAccessible (true );
45+ }
4446 $ ref ->setValue ($ this ->redis , $ this ->factory );
4547 }
4648
@@ -124,7 +126,9 @@ public function testPingWithAuthWillCreateUnderlyingClientWithAuthAndReturnPendi
124126 {
125127 $ this ->redis = new RedisClient ('user:pass@localhost ' );
126128 $ ref = new \ReflectionProperty ($ this ->redis , 'factory ' );
127- $ ref ->setAccessible (true );
129+ if (PHP_VERSION_ID < 80100 ) {
130+ $ ref ->setAccessible (true );
131+ }
128132 $ ref ->setValue ($ this ->redis , $ this ->factory );
129133
130134 $ promise = new Promise (function () { });
@@ -144,7 +148,9 @@ public function testPingWithUnixUriWillCreateUnderlyingClientAndReturnPendingPro
144148 {
145149 $ this ->redis = new RedisClient ('redis+unix:///tmp/redis.sock ' );
146150 $ ref = new \ReflectionProperty ($ this ->redis , 'factory ' );
147- $ ref ->setAccessible (true );
151+ if (PHP_VERSION_ID < 80100 ) {
152+ $ ref ->setAccessible (true );
153+ }
148154 $ ref ->setValue ($ this ->redis , $ this ->factory );
149155
150156 $ promise = new Promise (function () { });
@@ -193,7 +199,9 @@ public function testPingWillResolveWhenUnderlyingClientResolvesPingAndStartIdleT
193199 $ this ->redis = new RedisClient ('localhost?idle=10 ' );
194200
195201 $ ref = new \ReflectionProperty ($ this ->redis , 'factory ' );
196- $ ref ->setAccessible (true );
202+ if (PHP_VERSION_ID < 80100 ) {
203+ $ ref ->setAccessible (true );
204+ }
197205 $ ref ->setValue ($ this ->redis , $ this ->factory );
198206
199207 $ client = $ this ->createMock (StreamingClient::class);
@@ -218,7 +226,9 @@ public function testPingWillResolveWhenUnderlyingClientResolvesPingAndNotStartId
218226 $ this ->redis = new RedisClient ('localhost?idle=-1 ' );
219227
220228 $ ref = new \ReflectionProperty ($ this ->redis , 'factory ' );
221- $ ref ->setAccessible (true );
229+ if (PHP_VERSION_ID < 80100 ) {
230+ $ ref ->setAccessible (true );
231+ }
222232 $ ref ->setValue ($ this ->redis , $ this ->factory );
223233
224234 $ client = $ this ->createMock (StreamingClient::class);
0 commit comments