@@ -263,7 +263,9 @@ function (Frame $frame) use (&$controlFrame): void {
263263 */
264264 public function testMemoryLimits (string $ phpConfigurationValue , int $ expectedLimit ): void {
265265 $ method = new \ReflectionMethod (MessageBuffer::class, 'getMemoryLimit ' );
266- $ method ->setAccessible (true );
266+ if (PHP_VERSION_ID < 80100 ) {
267+ $ method ->setAccessible (true );
268+ }
267269 $ actualLimit = $ method ->invoke (null , $ phpConfigurationValue );
268270
269271 $ this ->assertSame ($ expectedLimit , $ actualLimit );
@@ -339,11 +341,15 @@ static function (Frame $frame): void {},
339341 }
340342
341343 $ prop = new \ReflectionProperty ($ messageBuffer , 'maxMessagePayloadSize ' );
342- $ prop ->setAccessible (true );
344+ if (PHP_VERSION_ID < 80100 ) {
345+ $ prop ->setAccessible (true );
346+ }
343347 $ this ->assertEquals ($ expectedLimit / 4 , $ prop ->getValue ($ messageBuffer ));
344348
345349 $ prop = new \ReflectionProperty ($ messageBuffer , 'maxFramePayloadSize ' );
346- $ prop ->setAccessible (true );
350+ if (PHP_VERSION_ID < 80100 ) {
351+ $ prop ->setAccessible (true );
352+ }
347353 $ this ->assertEquals ($ expectedLimit / 4 , $ prop ->getValue ($ messageBuffer ));
348354 }
349355
@@ -365,11 +371,15 @@ function (Frame $frame) {},
365371 );
366372
367373 $ prop = new \ReflectionProperty ($ messageBuffer , 'maxMessagePayloadSize ' );
368- $ prop ->setAccessible (true );
374+ if (PHP_VERSION_ID < 80100 ) {
375+ $ prop ->setAccessible (true );
376+ }
369377 $ this ->assertEquals (0 , $ prop ->getValue ($ messageBuffer ));
370378
371379 $ prop = new \ReflectionProperty ($ messageBuffer , 'maxFramePayloadSize ' );
372- $ prop ->setAccessible (true );
380+ if (PHP_VERSION_ID < 80100 ) {
381+ $ prop ->setAccessible (true );
382+ }
373383 $ this ->assertEquals (0 , $ prop ->getValue ($ messageBuffer ));
374384 }
375385}
0 commit comments