diff --git a/tests/system/AutoReview/FrameworkCodeTest.php b/tests/system/AutoReview/FrameworkCodeTest.php index a1d513e42b9c..ba4caf9f0a48 100644 --- a/tests/system/AutoReview/FrameworkCodeTest.php +++ b/tests/system/AutoReview/FrameworkCodeTest.php @@ -59,7 +59,7 @@ public function testDeprecationsAreProperlyVersioned(): void $deprecationsWithoutVersion = []; foreach ($this->getSourceFiles() as $file) { - $lines = file($file, FILE_IGNORE_NEW_LINES); + $lines = @file($file, FILE_IGNORE_NEW_LINES); if ($lines === false) { continue; @@ -156,6 +156,7 @@ private static function getTestClasses(): array FilesystemIterator::SKIP_DOTS, ), RecursiveIteratorIterator::CHILD_FIRST, + RecursiveIteratorIterator::CATCH_GET_CHILD, ); $testClasses = array_map( @@ -211,12 +212,17 @@ private function getSourceFiles(): array FilesystemIterator::SKIP_DOTS, ), RecursiveIteratorIterator::CHILD_FIRST, + RecursiveIteratorIterator::CATCH_GET_CHILD, ); /** @var SplFileInfo $file */ foreach ($iterator as $file) { if ($file->isFile() && str_ends_with($file->getPathname(), '.php')) { - $phpFiles[] = $file->getRealPath(); + $realPath = $file->getRealPath(); + + if ($realPath !== false) { + $phpFiles[] = $realPath; + } } } }