From 4d62088152e5459e977a941e0d6a881fe61dd5f9 Mon Sep 17 00:00:00 2001 From: Gintautas Miselis Date: Sun, 31 Jan 2021 13:50:02 +0200 Subject: [PATCH] Fix filter matching on Windows --- src/Codeception/Command/Run.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Codeception/Command/Run.php b/src/Codeception/Command/Run.php index c0f25d5ccc..568b0ccda1 100644 --- a/src/Codeception/Command/Run.php +++ b/src/Codeception/Command/Run.php @@ -540,7 +540,14 @@ protected function matchTestFromFilename($filename, $testsPath) { $filter = ''; if (strpos($filename, ':') !== false) { - list($filename, $filter) = explode(':', $filename, 2); + if ((PHP_OS === 'Windows' || PHP_OS === 'WINNT') && $filename[1] === ':') { + // match C:\... + list($drive, $path, $filter) = explode(':', $filename, 3); + $filename = $drive . ':' . $path; + } else { + list($filename, $filter) = explode(':', $filename, 2); + } + if ($filter) { $filter = ':' . $filter; }