From 1e59296d4be59cf0b08d62399897b0b2f65d3601 Mon Sep 17 00:00:00 2001 From: Andrew Roslik Date: Fri, 2 Sep 2016 19:32:10 +0300 Subject: [PATCH] Implemented #117: Make fast disabling synchronization with an issue tracker - Added supporting path to file. --- src/lib/PreCommit/Console/Command/Test.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/lib/PreCommit/Console/Command/Test.php b/src/lib/PreCommit/Console/Command/Test.php index d592f23..9538226 100644 --- a/src/lib/PreCommit/Console/Command/Test.php +++ b/src/lib/PreCommit/Console/Command/Test.php @@ -111,12 +111,16 @@ protected function getCustomTestFiles(InputInterface $input, OutputInterface $ou throw new Exception('Sorry, absolute path is not supported so far.'); } - $finder = new Finder(); - $finder->files()->in($path); - - /** @var SplFileInfo $file */ - foreach ($finder as $file) { - $customFiles[] = rtrim($path, '\\/').DIRECTORY_SEPARATOR.$file->getRelativePathname(); + if (is_file($path)) { + $customFiles[] = $path; + } else { + $finder = new Finder(); + $finder->files()->in($path); + + /** @var SplFileInfo $file */ + foreach ($finder as $file) { + $customFiles[] = rtrim($path, '\\/').DIRECTORY_SEPARATOR.$file->getRelativePathname(); + } } }