From 685dc702a0dc6c8490bf1d9c39f8a8072e4333f0 Mon Sep 17 00:00:00 2001 From: Grzegorz Korba Date: Thu, 4 Aug 2022 21:13:37 +0200 Subject: [PATCH] Ability to yield files with names (#2732) --- packages/Testing/PHPUnit/AbstractRectorTestCase.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/Testing/PHPUnit/AbstractRectorTestCase.php b/packages/Testing/PHPUnit/AbstractRectorTestCase.php index c894e1d18d8..3032ea1a431 100644 --- a/packages/Testing/PHPUnit/AbstractRectorTestCase.php +++ b/packages/Testing/PHPUnit/AbstractRectorTestCase.php @@ -102,6 +102,14 @@ protected function yieldFilesFromDirectory(string $directory, string $suffix = ' return StaticFixtureFinder::yieldDirectoryExclusively($directory, $suffix); } + /** + * @return Iterator> + */ + protected function yieldFilesWithPathnameFromDirectory(string $directory, string $suffix = '*.php.inc'): Iterator + { + return StaticFixtureFinder::yieldDirectoryExclusivelyWithRelativePathname($directory, $suffix); + } + protected function isWindows(): bool { return strncasecmp(PHP_OS, 'WIN', 3) === 0;