Skip to content

Commit

Permalink
Fix test on PHP 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mrook committed Apr 25, 2024
1 parent d236f63 commit 47c1d86
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/Phing/Test/Io/FileSystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,13 @@ public function testListContentsWithNumericName(): void
protected function resetFileSystem(): void
{
$refClass = new ReflectionClass(FileSystem::class);
$refProperty = $refClass->getProperty('fs');
$refProperty->setAccessible(true);
$refProperty->setValue(null);

if (version_compare(PHP_VERSION, '8.3.0', '>=')) {
$refClass->setStaticPropertyValue('fs', null);
} else {
$refProperty = $refClass->getProperty('fs');
$refProperty->setAccessible(true);
$refProperty->setValue(null);
}
}
}

0 comments on commit 47c1d86

Please sign in to comment.