@@ -111,7 +111,9 @@ public function testGetErrorMessage()
111111 $ this ->assertSame ('' , $ uploadedFile ->getErrorMessage ());
112112
113113 $ reflection = new ReflectionProperty ($ uploadedFile , 'error ' );
114- $ reflection ->setAccessible (true );
114+ if (PHP_VERSION_ID < 80100 ) {
115+ $ reflection ->setAccessible (true );
116+ }
115117
116118 $ reflection ->setValue ($ uploadedFile , UPLOAD_ERR_INI_SIZE );
117119 $ this ->assertSame (
@@ -239,7 +241,9 @@ public function testExceptionMoveToFileIsMoved()
239241 );
240242
241243 $ reflection = new ReflectionProperty ($ uploadedFile , 'isMoved ' );
242- $ reflection ->setAccessible (true );
244+ if (PHP_VERSION_ID < 80100 ) {
245+ $ reflection ->setAccessible (true );
246+ }
243247 $ reflection ->setValue ($ uploadedFile , true );
244248
245249 $ targetPath = self ::getTestFilepath ('logo_moved.png ' );
@@ -296,7 +300,9 @@ public function testExceptionMoveError()
296300
297301 $ this ->expectException ('RuntimeException ' );
298302 $ reflection = new ReflectionMethod ($ uploadedFile , 'moveFile ' );
299- $ reflection ->setAccessible (true );
303+ if (PHP_VERSION_ID < 80100 ) {
304+ $ reflection ->setAccessible (true );
305+ }
300306 // Exception => The target path "/tmp/folder-not-exists/test.png" is not writable.
301307 $ reflection ->invoke ($ uploadedFile , 'some/bogus/path ' );
302308 }
@@ -317,7 +323,9 @@ public function testExceptionMoveToFileNotUploaded()
317323 );
318324
319325 $ reflection = new ReflectionProperty ($ uploadedFile , 'sapi ' );
320- $ reflection ->setAccessible (true );
326+ if (PHP_VERSION_ID < 80100 ) {
327+ $ reflection ->setAccessible (true );
328+ }
321329 $ reflection ->setValue ($ uploadedFile , 'apache ' );
322330 // Exception => not an uploaded file
323331 $ uploadedFile ->moveTo ($ targetPath );
0 commit comments